Summary
Linux provides various
locking methods. They are designed to suit different requirement of kernel
developers. Semaphores are flexible and widely used. Mutexes are more
specialized and are used by experts. Wait queues are used in conditional
locking. The
atomic locks provide not only a locking mechanism but also arithmetic or
bitwise operations simultaneously. Spinlocks are commonly
used in interrupt context by developers; they are basis of semaphore and mutex
implementation.
References:
§
LDD3: by Jonathan
Corbet, Alessandro Rubini, and Greg Kroah-Hartman
§
Linux kernel spin lock documentation: by Linus Torvalds
Previous (Atomic Operation)
No comments:
Post a Comment