LWN.net Logo

Correction

Correction

Posted Apr 22, 2004 16:29 UTC (Thu) by proski (subscriber, #104)
Parent article: Driver porting: the workqueue interface.

Among other things, each workqueue has one or more dedicated worker threads (one per CPU) associated with it. So all tasks running out of workqueues have a process context, and can thus sleep.
This incorrectly implies that the task queue in 2.4 kernels is not run in the process context and cannot sleep. It's not true. The task queue is run in the context of the "keventd" process.

I believe the only significant difference is that the workqueue is processed in per-CPU threads whereas task queue is processed by a single kernel thread.


(Log in to post comments)

Correction

Posted Apr 22, 2004 16:41 UTC (Thu) by corbet (editor, #1) [Link]

Actually, 2.4 had several task queues, most of which did not run in process context. The scheduler queue, in later 2.4 kernels, runs out of keventd, but it is a single, shared thread. Workqueues have multiple, per-CPU threads which are dedicated to the queue. (When Rusty's patch goes in, single-thread workqueues will also be possible, though each queue will still have its own thread).

Workqueues also have nice features like a "flush" operation that can guarantee that your tasks are not running and will not run and a "delayed work" capability.

Copyright © 2008, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds