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.

Mutual exclusion and semaphores

I am writing a program (for homework) that simulates a unisex bathroom. Only 4 people are allowed at a time and …

c++ mutex semaphore
Is there a way to make jobs in Jenkins mutually exclusive?

I have a few jobs in Jenkins that use Selenium to modify a database through a website's front end. If …

mutex jenkins
Using std::mutex as member variable in a class

I have defined a class that has std::mutex my_mutex as its private member variable. But when I try …

c++11 mutex stdmutex
Using Pointers in a for loop

I'm struggling to understand why I have a bug in my code in one state but not the other. It's …

for-loop pointers go mutex
POSIX C Threads. Mutex example. Don't work as expected

I have a big problem, I can't figure out why mutexes in C don't work as I expect. This is …

c multithreading mutex multitasking
How to profile pthread mutex in linux?

I would like to know how to profile a pthread mutex to see if there are any locking contention points …

c++ c performance pthreads mutex
'mutex' is not a member of 'std' in MinGW 5.3.0

I am using MinGW 5.3.0 and Crypto++ 5.6.5: C:\MinGW>g++ -std=c++11 -s -D_WIN32_WINNT=0x0501 LOG.cpp -U__…

c++ c++11 mingw mutex crypto++
Are mutex lock functions sufficient without volatile?

A coworker and I write software for a variety of platforms running on x86, x64, Itanium, PowerPC, and other 10 year …

c++ multithreading mutex volatile memory-barriers
Massive CPU load using std::lock (c++11)

My recent efforts to implement a thread/ mutex manager ended up in an 75% CPU load (4 core), while all four running …

c++ c++11 mutex stdthread
Using std::mutex, std::condition_variable and std::unique_lock

I'm having some trouble understanding condition variables and their use with mutexes, I hope the community can help me with. …

c++ multithreading concurrency mutex condition-variable