Entering critical section and context switching in C ++

I am new to thread programming (currently I need to use win32 and C ++ in a company project) and I just want to ask if the entry is in the critical section without context switching? Does this mean that the thread blocks resources until it leaves the critical section?

Also, I am currently reading the book "Multithreaded Applications in Win32" and it seems good, but is there a more readable and more modern book for beginners to learn about threads in win32?

Thanks a lot in advance ^ _ ^

+4
source share
1 answer

, . , , .

MSDN ( ):

EnterCriticalSection TryEnterCriticalSection, . LeaveCriticalSection, . , EnterCriticalSection .

EnterCriticalSection :

. , .

" ". . . , : A B. A EnterCriticalSection CS. CS, OS B. B , , EnterCriticalSection, .

, Windows. , , "" ( " ?" "". ? ) "" , , ( CS). , EnterCriticalSection .

.

  • MSDN:
  • :
+4

All Articles