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.

Which is more efficient, basic mutex lock or atomic integer?

For something simple like a counter if multiple threads will be increasing the number. I read that mutex locks can …

multithreading operating-system pthreads mutex atomic
Differences between Conditional variables, Mutexes and Locks

For example the c++0x interfaces I am having a hard time figuring out when to use which of these …

c++ multithreading c++11 mutex condition-variable
Is it smart to replace boost::thread and boost::mutex with c++11 equivalents?

Motivation: reason why I'm considering it is that my genius project manager thinks that boost is another dependency and that …

c++ multithreading c++11 boost mutex
Should a return statement be inside or outside a lock?

I just realized that in some place in my code I have the return statement inside the lock and sometime …

c# .net multithreading mutex
Does pthread_cond_wait(&cond_t, &mutex); unlock and then lock the mutex?

I m using pthread_cond_wait(&cond_t, &mutex); in my program and I m wondering why this …

c pthreads mutex
Difference between Mutex, Semaphore & Spin Locks

I am doing experiments with IPC, especially with Mutex, Semaphore and Spin Lock. What I learnt is Mutex is used …

multithreading ipc mutex semaphore spinlock
Pthread mutex assertion error

I'm encountering the following error at unpredictable times in a linux-based (arm) communications application: pthread_mutex_lock.c:82: __pthread_mutex_…

linux pthreads mutex assert glibc
When is a condition variable needed, isn't a mutex enough?

I'm sure mutex isn't enough that's the reason the concept of condition variables exist; but it beats me and I'm …

multithreading operating-system synchronization mutex condition-variable
Share condition variable & mutex between processes: does mutex have to locked before?

I need to some little help to understand how to use condition variables in C to resolve an exercise. Here …

c pthreads ipc mutex condition-variable
What are the differences between various threading synchronization options in C#?

Can someone explain the difference between: lock (someobject) {} Using Mutex Using Semaphore Using Monitor Using Other .Net synchronization classes I …

c# multithreading synchronization locking mutex