Category Archives: Multithread C++

[pthread] RWlock

Reader-writer problem https://en.wikipedia.org/wiki/Readers%E2%80%93writers_problem Suppose we have a shared memory area with the basic constraints detailed above. It is possible to protect the shared data behind a mutual exclusion mutex, in… Read more »

[pthread] Spinlock

https://www.bogotobogo.com/cplusplus/multithreading_pthread.php Nhanh chóng chiếm được lock as soon as lock được nhả ra. Tiến trình đợi không ngủ liên tục chờ đợi. Nên dùng spinlock với trường hợp cần nhanh… Read more »