in reply to Re^11: Threads sharing global variable
in thread Threads sharing global variable
The unlock-and-block part of cond_wait() is atomic; hence, by the time another thread acquires the lock, this first thread is guaranteed to be in a waiting state.
But if the signalling thread signals before the other thread(s) reach the wait(); that signal can be lost.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^13: Threads sharing global variable
by Anonymous Monk on Mar 06, 2016 at 15:25 UTC | |
by BrowserUk (Patriarch) on Mar 06, 2016 at 15:34 UTC | |
by Anonymous Monk on Mar 06, 2016 at 15:45 UTC | |
by BrowserUk (Patriarch) on Mar 06, 2016 at 16:04 UTC | |
|
Re^13: Threads sharing global variable
by Anonymous Monk on Mar 06, 2016 at 15:31 UTC | |
by BrowserUk (Patriarch) on Mar 06, 2016 at 15:37 UTC |