This week's book giveaway is in the Programmer Certification forum. We're giving away four copies of OCP Oracle Certified Professional Java SE 11 Programmer I Study Guide: Exam 1Z0-815 and have Jeanne Boyarsky & Scott Selikoff on-line! See this thread for details.
Akshayyha Krishnamurthy wrote:
Could anyone explain me the differences among 'Mutual Exclusion', 'Critical Section', 'Synchronization', 'Hold and Wait' and 'No preemption'?
Mutual Exclusion, or the Mutex lock, is your basic lock that can be acquired. Only one thread can own the lock. And interestingly, most threading systems provide a similar mutex lock functionality -- common threading environments including Posix, Solaris, and Windows all have mutexes.
Critical section is basically a lightweight version of mutex, that was introduced by Windows. It behaves in many ways like a mutex with some limitations. The main limitation being that it only works in one process. And I think (I may be wrong), only Windows have this terminology.
Synchronization is also a lightweight version of mutex, that was introduced by Java. It also behaves in many ways like a mutex with some limitations. Also, in my opinion, this terminology seems to be with only Java.
As for the other two terms, one seem to be related to condition variables, and the other seems to be related to scheduling. Regardless, it may be out of context, so may need more information, to further discuss this.