Talk:Mutex: Difference between revisions

Critical sections on MSN
(Not familiar enough with critical sections.)
(Critical sections on MSN)
Line 2:
: With Win32 API CRITICAL_SECTION objects are often used as local mutexes, non-reentrant, if I correctly remember. They are less heavy weighted than mutex objects, which can serve as global mutexes. --[[User:Dmitry-kazakov|Dmitry-kazakov]] 09:25, 3 November 2008 (UTC)
:: I know of CRITICAL_SECTIONs and of some of their tradeoffs, but I haven't used them enough to write code from memory. I also don't have a Win32 programming environment readily available at home, and I'm prohibited from working on Rosetta Code on company hardware. If someone wanted to add setup, lock, unlock and destruction code for CRITICAL_SECTIONs, that would be entirely appropriate, though. --[[User:Short Circuit|Short Circuit]] 03:58, 4 November 2008 (UTC)
:::If anybody is interested to add critical sections, the API is
:::* InitializeCriticalSection creates the mutex,
:::* DeleteCriticalSection destroys it,
:::* EnterCriticalSection acquires it,
:::* LeaveCriticalSection releases it.
:::Source: [http://msdn.microsoft.com/en-us/library/ms682530(VS.85).aspx MSN] --[[User:Dmitry-kazakov|Dmitry-kazakov]] 08:59, 4 November 2008 (UTC)