https://github.com/c0de4un/simple-spin-lock
Simple Spin Thread-Lock Example
https://github.com/c0de4un/simple-spin-lock
cpp cxx multi-threading multithreading mutex posix-thread pthread raii spin-lock spinlock thread threading threads win-thread winthread
Last synced: 4 months ago
JSON representation
Simple Spin Thread-Lock Example
- Host: GitHub
- URL: https://github.com/c0de4un/simple-spin-lock
- Owner: c0de4un
- License: mit
- Created: 2020-03-13T13:21:26.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-03-14T18:11:15.000Z (almost 6 years ago)
- Last Synced: 2025-01-09T16:03:16.596Z (about 1 year ago)
- Topics: cpp, cxx, multi-threading, multithreading, mutex, posix-thread, pthread, raii, spin-lock, spinlock, thread, threading, threads, win-thread, winthread
- Language: C++
- Size: 50.8 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# simple-spin-lock
Simple Spin Thread-Lock Example
# What is inside ?
Example of custom thread-lock method replacing default STL (Boost, NDX or any other)
thread-lock logic.
# What is spin-lock ?
In cases, when hardware memory transaction is unavailable, spin-lock
allows to save some amount of CPU time, by avoiding unnecessary
synchronization between threads in case of samll operation.
# Usage
Use slock.hpp to reconfigure. For example to use other mutex-type.
# Features
- RAII, means, that mutex & locks are automatically unlocked (exceptions-safe);
- C++ way to handle atomic-logic, not C;