---

Deferrable functions, kernel tasklets, and work queues

“Summary: For high-frequency threaded operations, the Linux®
kernel provides tasklets and work queues. Tasklets and work queues
implement deferrable functionality and replace the older
bottom-half mechanism for drivers. This article explores the use of
tasklets and work queues in the kernel and shows you how to build
deferrable functions with these APIs.

“This article explores a couple of methods used to defer
processing between kernel contexts (specifically, within the
2.6.27.14 Linux kernel). Although these methods are specific to the
Linux kernel, the ideas behind them are useful from an
architectural perspective, as well. For example, you could
implement these ideas in traditional embedded systems in place of a
traditional scheduler for work scheduling.

“Before diving into the methods used in the kernel to defer
functions, however, let’s start with some background on the problem
being solved. When an operating system is interrupted because of a
hardware event (such as the presence of a packet through a network
adapter), the processing begins in an interrupt. Typically, the
interrupt kicks off a substantial amount of work. Some amount of
this work is done in the context of the interrupt, and work is
passed up the software stack for additional processing (see Figure
1).”


Complete Story

Get the Free Newsletter!

Subscribe to Developer Insider for top news, trends, & analysis