Home of LMC

LMC stands for Linux Mutexes and Conditions. It is a small C header file and source file which implements these mutual exclusion and synchronization primitives to be used in Linux kernel programming. It comes with a brief white paper that explains why these things are useful, and how they are used.

You can download the original version, lmc-0.1. This is a very old (1999!) version which should be considered experimental. For years, it was the only published version.

Since 1999, I have used LMC in some serious kernel work, and improved it. I not only ported it to the 2.6 kernel, but added a very cool function. With this cool function you can unlock a mutex to wait on a condition variable, with a timeout, while also polling any one of a set of kernel file (struct file *) or kernel socket (struct socket *) descriptors to become active! This is unbelievably useful for, for instance, writing a service thread which multiplexes I/O, while also responding to requests deposited into, say, a synchronized queue.

And thus, finally, here is this new version made public, eleven years later: lmc-2.0.

Return to Home page.