Replace spin lock with a signal

I have many spin locks in my multi-threaded code, and most of the time they wait for other threads to work, and thus chew on CPU usage. On linux, I usually use pthread_cond_wait and pthread_cond_signal to pause a thread and wake up when it is signaled. Is there something similar in acceleration libraries? Having a quick look, I could not find anything.

Visual studio 2005

+3
source share
2 answers

. Boost Mutex Semaphore.

Mutex - , , .

, (Mutex) .

+1

Source: https://habr.com/ru/post/1709646/


All Articles