Subject: Re: Kernel threads
To: Matt Thomas <matt@3am-software.com>
From: Jason Thorpe <thorpej@wasabisystems.com>
List: tech-kern
Date: 10/03/2003 06:02:38
On Thursday, September 25, 2003, at 10:49  AM, Matt Thomas wrote:

> As the number of kernels threads increases (every thread seems to want 
> one)
> I wonder if we should switch to a different model.  Instead of having 
> one
> thread per "task", maybe we should adopt the common mechanism of 
> having a
> crew of worker threads ready to do work.
>
> If higher level code want something to take place in a thread, it would
> allocate a "work unit" and queue it to be executed.  (which would a 
> wake
> a waiting thread and let it dequeue the work unit and call the routine
> indicated in).

I have something kind of like this in the sysmon code (originally it 
was in the acpi code) ... I think it might be kind of useful, yah, to 
have something like this generically.  I do think, however, that having 
the ability to allocate dedicated kthreads to certain types of tasks is 
useful, so we should keep that around, too.

Need to make sure we get resource allocation right for a generic 
"taskq" implementation.

         -- Jason R. Thorpe <thorpej@wasabisystems.com>