
Hi, Just a short question: Do you think I need a mutex for the 'static boost::barrier(nThreads)' lines in the sample code snippet below ? I always thought that static data in a function has to be protected by a mutex. But even with 16 running threads in parallel everything seems to be fine (it's a machine with 8 hardware cores, no HT). Thanks in advance - Hans int nThreads; // initialized later in main() void testing() { static boost::barrier barrier_one(nThreads); // mutex needed for 'local static' ? log("waiting on barrier_one"); barrier_one.wait(); do_complicated_stuff_simulaneously(); log("passed barrier_one"); static boost::barrier barrier_two(nThreads); // mutex needed for 'local static' ? log("waiting on barrier_two"); barrier_two.wait(); do_more_complicated_stuff_simulaneously(); log("passed barrier_two"); }