$include_dir="/home/hyper-archives/boost-users/include"; include("$include_dir/msg-header.inc") ?>
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