c - Signal counter while waiting on condition variable -


does condition variable have number - number of times has been signaled associated (like semaphore)? i.e., if 5 threads signal condition variable, , assuming of them canceled, possible condition variable waited on 5 other threads, afterwards? or, 1 thread unblock after calling wait?

if 5 threads signal condition variable, , assuming of them canceled, possible condition variable waited on 5 other threads, afterwards?

although language , implementation specific, typically answer there not number. if condition signalled without there being threads waiting on condition signals lost. if 5 signals generated , thread waits on condition, has wait next signal delivered.

now question c (i assume posix threads) can add details pthread_cond_signal() manual:

the pthread_cond_broadcast() , pthread_cond_signal() functions shall have no effect if there no threads blocked on cond.

there no counter keeps track of posix condition signals.


Comments

Popular posts from this blog

ios - iPhone/iPad different view orientations in different views , and apple approval process -

monitor web browser programmatically in Android? -

c# - Using multiple datasets in RDLC -