id summary reporter owner description type status milestone component version severity resolution keywords cc 4725 Synchronisation and shared mutex's Get total_count dominicstreeter@… Anthony Williams "Hey there I wish to create what is in essence a barrier but with the capacity to flexibly dictate how many threads are in the barrier. The problem is synchronising. Here is an example of the problem that shows I need to get the total count of threads accessing the shared total_count variable atomically from the boost library. I would like to know if there is a reason this is not implemented. Here are some variables to demonstrate the issue. boost::condition_variable_any multiThreadLinkReady; boost::shared_mutex smutDependancyThreadCustomBarrierReady; bool boolIsSceneReady; //Run by a management thread void wakeUpIfAllReady() { mutAccessData.lock(); if (intThreadsCaughtCountPost >= TOTALTHREADSLOADINGSCENE) { if (Here I need to the total count to also equal the Constant TOTALTHREADSLOADINGSCENE to garuntee every thread wakes up in a one time call to notify all of them into the next stage) multiThreadLinkReady.notify_all(); boolIsSceneReady = true; } mutAccessData.unlock(); } //Run by every thread but the management thread relating to this data void waitUntilAllReady() { mutAccessData.lock(); if (boolIsSceneReady == false) { intThreadsCaughtCountPost++; mutAccessData.unlock(); //The thread is set to frozen to be awoken on the next line when the class is ready. It possible for this to not be set before the other thread calls notify all! multiThreadLinkReady.wait(smutDependancyThreadCustomBarrierReady); //So we can reuse this on the next level loaded we need to decrement the counter. mutAccessData.lock(); intThreadsCaughtCountPost--; mutAccessData.unlock(); } else { mutAccessData.unlock(); } } There is no way of avoiding using interrupts when using the available barrier mechanism with a complex system involving alot of states this is not always desirable. If a thread were to fail and you needed to bail the other threads out of the barrier class you need to do alot more than if you can use a conditional variable like this and get the total threads that are actively waiting, creating a flexible barrier." Feature Requests closed To Be Determined thread Boost 1.44.0 Problem worksforme Synchronisation Barriers Get total_count