Math, asked by albannongrum9811, 1 year ago

Difference between critical section and mutex

Answers

Answered by riddhiporwal123
1
For Windows, critical sections are lighter-weight than mutexes. Mutexes can be shared between processes, but always result in a system call to the kernel which has some overhead. ... In the case of contention, they enter the kernel to wait on some synchronization primitive (like an event or semaphore).

Róunak: hahaha...directly copied from google......
Róunak: dont copy.....try to write it ursrlf
Answered by Róunak
0
1)Critical sections are lighter-weight than mutexes. 

2)Critical sections are faster than mutexes since critical sections are primarily user mode primitives - in the case of an uncontended acquire (usually the common case) there is no system call into the kernel, and acquiring takes on the order of dozens of cycles.

3)critical sections can only be used to synchronize resources in one process. In order to synchronize across multiple processes, a mutex is needed. 
Similar questions