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.

What is the Swift equivalent to Objective-C's "@synchronized"?

I've searched the Swift book, but can't find the Swift version of @synchronized. How do I do mutual exclusion in …

concurrency mutex swift
What is a good pattern for using a Global Mutex in C#?

The Mutex class is very misunderstood, and Global mutexes even more so. What is good, safe pattern to use when …

c# concurrency mutex
Mutex lock threads

Am new to multi threaded/processs programming. So here's what I need to clarify. Process A code pthread_mutex_lock() …

c linux pthreads mutex multiprocess
Example for boost shared_mutex (multiple reads/one write)?

I have a multithreaded app that has to read some data often, and occasionally that data is updated. Right now …

c++ multithreading boost mutex boost-thread
understanding of pthread_cond_wait() and pthread_cond_signal()

Generally speaking, pthread_cond_wait() and pthread_cond_signal() are called as below: //thread 1: pthread_mutex_lock(&mutex); pthread_…

c++ multithreading mutex
Concurrent HashSet<T> in .NET Framework?

I have the following class. class Test{ public HashSet<string> Data = new HashSet<string>(); } I need …

c# multithreading thread-safety locking mutex
PTHREAD_MUTEX_INITIALIZER vs pthread_mutex_init ( &mutex, param)

Is there any difference between pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER; Or pthread_mutex_t lock; pthread_mutex_init ( &…

c ubuntu pthreads mutex
pthreads mutex vs semaphore

What is the difference between semaphores and mutex provided by pthread library ?

c linux synchronization pthreads mutex
Why do pthreads’ condition variable functions require a mutex?

I’m reading up on pthread.h; the condition variable related functions (like pthread_cond_wait(3)) require a mutex as …

c pthreads mutex condition-variable