Single-threaded workqueues
For many applications, one process per CPU is far more than is needed; a single worker process is plenty. There is a shared, generic workqueue which can be used in many of these situations. In others, however, use of that queue is not appropriate; perhaps the code in question performs long sleeps, or it may deadlock with another use of that queue. In these cases, there has been no alternative to paying the cost of all those worker threads.
As of 2.6.6, thanks to Rusty Russell, there will be a new function for creating workqueues:
struct workqueue_struct *create_singlethread_workqueue(char *name);
As you might expect, this function creates a workqueue that relies on a
single worker thread. Chances are, many of the current users of workqueues
could switch over to the single-threaded variety.
| Index entries for this article | |
|---|---|
| Kernel | Workqueues |
