Top "Mutex" questions

A mutex ("mutual exclusion") is a mechanism to ensure integrity when the same data or resource is accessed (in particular, changed) concurrently from several threads.

Difference between std::mutex lock function and std::lock_guard<std::mutex>?

Basically, the title is self-explanatory. I use it in following way: The code is in Objective-C++. Objective-C classes make concurrent …

multithreading c++11 mutex objective-c++
ReleaseMutex : Object synchronization method was called from an unsynchronized block of code

I have this pretty straightforward piece of code that very rarely throws "System.ApplicationException : Object synchronization method was called from …

multithreading thread-safety mutex thread-synchronization
Fair critical section (Linux)

On a multi-threaded Linux application I use a mutex for critical sections. This works very well except for the fairness …

linux pthreads mutex critical-section
Are mutexes really slower?

I have read so many times, here and everywhere on the net, that mutexes are slower than critical section/semaphores/…

windows multithreading mutex
Synchronize threads for pthread_cond_broadcast call

I have a simple application with a "manager" thread that spawns ten simple "worker" threads. I want all of the "…

c pthreads mutex conditional-statements barrier
Why boost::recursive_mutex is not working as expected?

I have a custom class that uses boost mutexes and locks like this (only relevant parts): template<class T&…

c++ boost locking mutex recursive-mutex
When are lock free data structures less performant than mutual exclusion (mutexes)?

I read somewhere (can't find the page anymore) that lock free data structures are more efficient "for certain workloads" which …

multithreading scheduling mutex atomic lock-free
How To Use Condition Variable

The Linux Programming Interface book has a piece of code (producer/consumer) to show how condition variable works: static pthread_…

c pthreads mutex condition-variable
Regarding WaitOne() method of Mutex Type

I have written a small piece of code. something like below public static void SetLicence1() { Console.WriteLine("Setting Aspose Licence …

c# mutex waitone
Are there C++11 critical sections?

I'm trying to find the equivalent of a critical section for C++11 , is the new C++11 mutex concept process-bound (e.…

c++ c++11 mutex critical-section