Top "Critical-section" questions

Critical section refers to either a piece of code that will run concurrently in several threads accessing global data or resources (requiring synchronisation), or a user-level spinlock combined with a mutex object under the Windows operating system.

Is it valid to nest a critical section?

For example, would this be valid? CRITICAL_SECTION cs; ::InitializeCriticalSection( &cs ); ::EnterCriticalSection( &cs ); // First level ::EnterCriticalSection( &cs ); // …

c++ winapi critical-section
How to use Multiple Variables for a lock Scope in C#

I have a situation where a block of code should be executed only if two locker objects are free. I …

c# multithreading locking critical-section
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
Critical Section in JavaScript or jQuery

I have a webpage, in which a certain Ajax event is triggered asynchronously. This Ajax section could be called once …

javascript jquery semaphore critical-section mutual-exclusion
VC++ 2010: Weird Critical Section error

My program is randomly crashing in a small scenario I can reproduce, but it happens in mlock.c (which is …

c++ windows multithreading visual-c++ critical-section
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