Boost logo

Boost :

From: Alexander Terekhov (terekhov_at_[hidden])
Date: 2003-10-20 17:46:53


"E. Gladyshev" wrote:
[...]
> If you are interested, we can discuss this condition
> in more details. It is not as straight forward as it might seem.

Real mutexes are designed for memory sharing, not isolation.

"Some have complained that POSIX mutexes don't allow a locking thread
 to detect that the previous owner terminated "abnormally"... that's
 because it wouldn't do any good to know without isolation between
 the entities involved. With IPC mechanisms it makes sense to know,
 because you can do something about it."

"Counting semaphores are well matched to dealing with
 producer/consumer problems, including those that might exist
 between threads of different processes, or between a signal handler
 and a thread. In the former case, there may be LITTLE OR NO MEMORY
 shared by the processes; in the latter case, one is not
 communicating between co-equal threads, but between a thread and an
 interrupt-like entity. It is for these reasons that IEEE Std
 1003.1-2001 allows semaphores to be used by threads."

regards,
alexander.


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