There is an existing question regarding difference between Mutex and Critical section but it does not deal with Locks also.
So i want to know whether Critical sections can be used for thread synchronisation between processes.
Also what is meant by signalled states and non-signalled states
In Windows critical sections are (mostly) implemented in user mode, and a mutex will switch context to kernel mode (which is slow). If a thread terminates while owning a mutex, the mutex is said to be abandoned. The state of the mutex is set to signaled, and the next waiting thread gets ownership. In the same situation with a critical section all other threads will remain blocked. Critical sections cannot be named so you cannot use them to synchronize several processes.
CriticalSections are in process. Named mutexes can be used across processes
Lock is a general term and as such I wouldn't know which platform you mean. For example in C# a lock primitive is a Critical Section.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With