Locks

The mutual exclusion is a very important utility needed in multithreaded programs. You will study locks in this lesson, that serve this purpose.

Beyond thread creation and join, probably the next most useful set of functions provided by the POSIX threads library are those for providing mutual exclusion to a critical section via locks. The most basic pair of routines to use for this purpose is provided by the following:

Get hands-on with 1200+ tech skills courses.