The difference between critical section and mutex object

Both critical section (CRITICAL_SECTION) and mutex object (MUTEX OBJECT) can perform thread synchronization to prevent threads from being interrupted.
The difference is that critical sections can only be used within the same process. If you want to coordinate two processes that share some resource (such as shared memory), you can't use a critical section, but a mutex.

Guess you like

Origin blog.csdn.net/a1663049254/article/details/90953566