|
Boost Users : |
Subject: [Boost-users] Semaphores vs. condition_variable with valgrind/helgrind
From: Chris Stankevitz (chrisstankevitz_at_[hidden])
Date: 2012-08-11 21:50:38
Hello,
Does boost provide a semaphore (aka an implementation of pthreads's
sem_post and sem_wait)? I know boost provides a condition_variable.
However, I would prefer a true POSIX semaphore. I created a
"semaphore" using internally boost condition variables.
Valgrind's tool "helgrind" is reporting false positives on my
implentation of a semaphore due to my use of condition_variables.
According to http://www.valgrind.org/docs/manual/hg-manual.htm
Avoid POSIX condition variables. If you can, use POSIX semaphores
(sem_t, sem_post, sem_wait) to do inter-thread event signalling.
Thank you,
Chris
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net