DragonFlyBSD threading model
Erik Wikström
erik-wikstrom at telia.com
Mon Aug 1 14:00:52 PDT 2005
On 2005-08-01 17:14, Matthew Dillon wrote:
:Hi,
:
:I have been reading up about how the different BSD systems are
:handling SMP and threading. I gather NetBSD uses scheduler
:activations, where userland programs are given virtual CPUs which then
:get mapped to kernel threads for execution (please correct me if my
:analysis is wrong). FreeBSD appears to use a variant of this idea
:called KSEs. I believe this is known as M:N.
:
:I am not however sure exactly how DragonFlyBSD threads work - each CPU
:has an LWKT scheduler, and that above this layer there is also a
:userland scheduler (partially equivalent to the functionality provided
:by sched_4bsd.c under FreeBSD?) - but my question is how that relates
:to userland programs - when they have threads..does each program
:thread map directly to one of the LWKT schedulers on one of the CPUs?
:Does that make it 1:1?
:
:I apologise if this seems like an extremly novide question, this stuff
:is all very new to me.
:
:Thanks in advance, Alex J Burke.
Basically everything gets mapped onto a LWKT (Light Weight Kernel Thread),
including userland processes.
The LWKT scheduler is a fixed priority scheduler. For example, if you
do a 'ps ax' you will see a ton of kernel threads in addition to userland,
including threads for handling interrupts. Priorities work something
like this:
I've been wondering for some time how the number of LWKT are determined?
Are they created when needed (on interrupts etc) or are there a fixed
amount?
--
Erik Wikström
More information about the Kernel
mailing list