On Wed, Feb 18, 2004 at 06:15:58PM +0300, Vladimir Prus wrote:
The interesting part of "POSIX on semaphores" is in
Look the the phrase "Much experience with semaphores shows" and futher paragraphs. In essense, it's says that semaphores are for signal handlers and for inter-process synchronization and discourages their use anywhere else.
That's an interesting link, thanks! I don't interpret the text in the same way that you do, but maybe I am not understanding something properly. Further down from "Much experience with semaphores shows", there is this text: "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." This is the use-case that I am interested in. -- Craig Rodrigues http://crodrigues.org rodrigc@crodrigues.org