Skip to Main Content
Hands-On System Programming with Linux
book

Hands-On System Programming with Linux

by Kaiwan N. Billimoria, Tigran Aivazian
October 2018
Beginner content levelBeginner
794 pages
19h 23m
English
Packt Publishing
Content preview from Hands-On System Programming with Linux

The mutex lock

The word mutex is really an abbreviation for mutual exclusion; to the mutual exclusion of all other (loser) threads, one thread—the winner—holds (or owns) the mutex lock. Only when it is unlocked can another thread take the lock.

An FAQ: What really is the difference between the semaphore and the mutex lock? Firstly, the semaphore can be used in two ways—one, as a counter (with the counting semaphore object), and two (relevant to us here), essentially as a mutex lock—the binary semaphore. Between the binary semaphore and the mutex lock, there exists two primary differences: one, the semaphore is meant to be used to synchronize between processes and not the threads internal to a single process (it is indeed a well-known IPC ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Linux System Programming Techniques

Linux System Programming Techniques

Jack-Benny Persson
Linux Device Drivers, Second Edition

Linux Device Drivers, Second Edition

Jonathan Corbet, Alessandro Rubini

Publisher Resources

ISBN: 9781788998475Supplemental Content