Difference between critical section and mutex
Answers
Answered by
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......
Answered by
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.
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
Math,
7 months ago
Math,
7 months ago
Social Sciences,
1 year ago
Math,
1 year ago
Social Sciences,
1 year ago
Social Sciences,
1 year ago