Boost logo

Boost :

From: Alexander Terekhov (terekhov_at_[hidden])
Date: 2001-10-22 13:49:15


> BTW, the claim that putting a maximum count for a semaphore leads to race
> conditions is, I believe, only true for "weak" semaphores. For strong
> semaphores with a maximum count value, the increment/up/signal/V and
> decrement/down/wait/P operations are symmetric.

well, you could certainly check whether sem_cnt + sem_signaled <= MAX.
but what is the purpose of such checking? e.g. it does not count
threads already unblocked (not counted by sem_waiting/sem_signaled)
but still on the way out of lock/wait/dec/down/P() call.

regards,
alexander.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk