views:

409

answers:

1

I've been reading about Linux Kernel development / device drivers and all of the books I've looked at use the pre-2.6.20 workqueue interface. This includes the Linux Kernel Module Programming Guide, Robert Love's Linux Kernel Development, and Sreekrishnan Venkateswaran's Essential Linux Device Drivers which was published in April 2008!

Does anyone have a guide to using the "new" 2.6.20+ workqueue interface?

Just for reference, Ubuntu 8.04 which I'm developing on at the moment, was released over a year and a half ago and includes kernel 2.6.24.

Edit

stsquad's answer led me to this guide to porting code to the new 2.6.20 workqueue's.

+3  A: 

You can't go wrong with the excellent API articles on LWN (http://lwn.net/Kernel/Index/) which document a lot of the new APIs as they go into the kernel. There is a whole section devoted to Workqueues which is worth a read.

Workqueues have been in the kernel for a while so I assume your thinking about the recent-ish rework of the API.

Whilst I'm at it I can heartily recommend a subscription to LWN. All their articles are available for free after a week or so but it's worth supporting the high quality writing, especially if your an aspiring kernel hacker.

stsquad
+1: Thanks. Do you have any links to a tutorial / guide on actually using the new workqueue interface? Or do you know of say a fairly simple driver in the source tree that could serve as a good example?
Robert S. Barnes
In terms of simple drivers that don't require intimate knowledge of the rest of the kernel I suggest the vt code (drivers/char/vt.c) or maybe the sysreq driver (drivers/char/sysrq.c). Otherwise grep around for queue_work in a subsystem you are familiar with.The Documentation directory includes some specific examples for various subsystems (e.g. deferred IO) although they usually wrap it up in their own subsystem specific framework.
stsquad
Your answer led me to this guide to porting code to the new 2.6.20 workqueue's: http://lwn.net/Articles/213149/
Robert S. Barnes