DragonFly BSD
DragonFly kernel List (threaded) for 2003-08
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: Userland threading and messaging

From: Joerg Sonnenberger <joerg@xxxxxxxxxxxxxxxxx>
Date: Sat, 16 Aug 2003 11:05:23 +0200

On Sat, Aug 16, 2003 at 03:30:57AM -0500, Chip Norkus wrote:
> What about thread-to-processor binding?  For compute-bound programs it is 
> very nice to be able to explicitly stick threads onto different CPUs.  
> For that there would need to be some kind of kernel code at least.

Right. Not only compute-bound programs, but things like webservers
have there use for sticking too. That's what I meant with the virtual
CPUs. The process asks the kernel to provide e.g. 4 virtual CPUs.
In fact this are just some more LWPs. Now we have the userland
scheduler utilizing these virtual CPUs like it knows best. Consider
the webserver having 4 socket handling threads and 4 processing threads.
It wants one handling and one processing thread per virtual CPU to
simplify locking. The second part is the kernel scheduling the
virtual CPUs to the different physical CPUs. That the place to add
static VCPU-CPU mapping.

As a side note, this should be implementable even by a junior hacker
like me since it is considerably simpler than e.g. KSE.


> [snip]
> >
> > Joerg
> -wd
> -- 
> chip norkus; renaissance hacker;                wd@xxxxxxxx
> "question = (to) ? be : !be;" --Shakespeare     http://telekinesis.org/

[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]