Common deadlock types

Thinking about a couple of typical deadlock scenarios will help the reader understand it better. Recall that the basic premise of a lock is that there can only be one winner (the thread that obtained the lock) and N-1 losers. Another key point is that only the winner thread can perform the unlock operation—no other thread can do so.

Get Hands-On System Programming with Linux now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.