I am using boost 1.4开发者_运维问答1.0. Is there a way to use boost to find how many people are waiting on the lock?No: there is no way to get a reliable answer as it could change before the function
We have several locks (boost::mutex) in static classes, but when the program exits, pthread_mutex_destroy fails in the destructor of the mutex (there is an assertion checking this in boost).
I\'m working on 2 Windows Services that have a common开发者_开发问答 database which I want to lock (cross-process) with a system Mutex.
I have a parent and a worker thread that share a bool flag and a std::vector. The parent only reads (i.e., reads the bool or calls my_vector开发者_如何学运维.empty()); the worker only writes.
When a thread tries to enter a critical section and obtain a lock, what is it actually doing? I\'m asking this because I usually create an object (of type object) which will serve for locking purpose
In continuation for my latest ponders about locks in C# and .NET, Consider the following scenario: I have a class which contains a specific collection (for this example, i\'ve used a Dictionary<s
Is there a mechanism to have a conditional variable use multiple mutexes? I am in Linux and pthreads in C++.
My applica开发者_运维技巧tion is very very speed esential and even a microsecond matters.I am using semaphore(1,1) at varios places. I think it can be easily converted into mutex.But I want to know if
I am a bit confused 开发者_高级运维on how to declare a recursive mutex using pthread. What I try to do is have only one thread at a time be able to run a piece of code(including functions) but after s
I have a shared memory pool from which many different threads may request an allocation. Requesting an allocation from this will occur a LOT in every thread, however the amount of thr开发者_开发问答ea