Boost logo

Boost :

Subject: [boost] Mutex vs Semaphore
From: Jean-Sebastien Stoezel (js.stoezel_at_[hidden])
Date: 2009-04-02 22:21:31


Hi,

I need to synchronize 2 threads, that is once one is done doing
something, it should activate another thread that had been waiting in
a pending state.
I see the thread library offers mutexes and nothing else. I guess
mutexes would do, but I do not believe I should use mutexes for my
application. Mutexes are supposed to provide mutual exclusion when
critical data is accessed. Semaphores should be used for what I want
to do.

However, I only see semaphores available in the interprocess library.
I only need inter-thread synchronization, and going the long way with
the interprocess library seems a bit overkill.

It may be an ideology issue here. I would appreciate your comments on
what to use in this case.

Thanks,
Jean


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