Hi,
I'm using boost::bind for creating a thread group. My code shows this
way:
boost::thread_group l_threadgroup;
for(std::size_t i=0; i < boost::thread::hardware_concurrency(); ++i)
l_threadgroup
.create_thread( boost::bind( &ncd<T>::multithread_deflate_symmetric,
this, i ) );
The code runs within the class method "symmetric" and should be called
from the self object the multithread_deflate_symmetric.
My class "ncd" is a template class. I debug the code on a amd64 Gentoo
Linux with valgrind 3.5 and get a "data race condition".
Valgrind shows this message:
==6914== Possible data race during read of size 8 at 0x7fefff6d0 by
thread #1
==6914== at 0x4C2B138: ??? (in /usr/lib64/valgrind/
vgpreload_helgrind-amd64-linux.so)
==6914== by 0x6152B10: boost::thread::start_thread() (in /opt/
library/Boost/1.44/lib/libboost_thread.so.1.44.0)
==6914== by 0x414B50:
boost::thread::thread