Serializing tokens

In computer science, serializing tokens are a concept in concurrency control arising from the ongoing development of DragonFly BSD.

Serializing tokens allow programmers to write multiprocessor-safe code without themselves or the lower level subsystems needing to be aware of every single entity that may also be holding the same token.

Unlike mutexes, tokens do not exclude other threads from accessing the resource while they are blocked or asleep.

Issues such as deadlock and priority inversion can be very difficult to avoid, and require coordination at many levels of the kernel.

If you look at FreeBSD-5, you will notice that FreeBSD-5 passes held mutexes down the subroutine stack quite often, in order to allow some very deep procedural level to temporarily release a mutex in order to switch or block or deal with a deadlock.