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.

How pthread_mutex_lock is implemented

I am just curious to know how functions related to synchronization between threads are implemented inside Unix. For example, what …

linux unix synchronization pthreads mutex
Do I need a mutex for reading?

I have a class that has a state (a simple enum) and that is accessed from two threads. For changing …

c++ multithreading mutex
What is the Mutex and semaphore In c#? where we need to implement?

What is the Mutex and semaphore in C#? Where we need to implement? How can we work with them in …

c# multithreading mutex semaphore
How Compare and Swap works

I have read quite some posts that say compare and swap guarantees atomicity, However I am still not able to …

c multithreading mutex compare-and-swap
How to wait for a boolean without looping (using any kind of wait / semaphore / event / mutex, etc)

I need to stop a thread until another thread sets a boolean value and I don't want to share between …

c# .net multithreading mutex semaphore
Overhead of pthread mutexes?

I'm trying to make a C++ API (for Linux and Solaris) thread-safe, so that its functions can be called from …

c++ linux performance pthreads mutex
System-wide mutex in Python on Linux

Is there any easy way to have a system-wide mutex in Python on Linux? By "system-wide", I mean the mutex …

python linux mutex
what is the "attribute" of a pthread mutex?

The function pthread_mutex_init allows you to specify a pointer to an attribute. But I have yet to find …

attributes pthreads mutex
PHP mutual exclusion (mutex)

Read some texts about locking in PHP. They all, mainly, direct to http://php.net/manual/en/function.flock.php . …

php mutex mutual-exclusion
If you unlock an already unlocked mutex, is the behavior undefined?

If you unlock an already unlocked mutex, is the behavior unsafe, safe, or undefined? The purpose of the question is …

multithreading mutex