Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 24 Nov 1999 12:01:20 -0800 (PST)
From:      Matthew Dillon <dillon@apollo.backplane.com>
To:        "Louis A. Mamakos" <louie@TransSys.COM>
Cc:        Daniel Eischen <eischen@vigrid.com>, "Daniel C. Sobral" <dcs@newsguy.com>, Julian Elischer <julian@whistle.com>, freebsd-arch@freebsd.org
Subject:   Re: Threads 
Message-ID:  <199911242001.MAA20386@apollo.backplane.com>
References:  <Pine.SUN.3.91.991124141640.316A-100000@pcnet1.pcnet.com>  <199911241957.OAA42011@whizzo.transsys.com>

index | next in thread | previous in thread | raw e-mail


:
:Wow, so this has turned way too complicated.  I confess to having the same
:basic questions as Matt; why all this complexity?  I think the answer is
:that there's a belief that having the kernel context switch between threads
:is too expensive, thus the desire to multiplex "user" threads on to fewer
:"kernel scheduled" threads.
:
:To answer your question: I think the question you're asking doesn't make
:any sense.  I think Matt was proposing that there's simply a kernel
:thread context that exists for each and every "user" thread that's active
:in the application.  Today, there's only one of these that's intimately
:associated with the process context (contains MMU/VM cntext, file descriptors,
:etc.)

    I'm off to LA so I can't continue this conversion.  Let me just try to
    clarify my position:

    I'm all for user-level thread schedulers, but I believe that the actual
    context switching should be done by the kernel for several reasons.  The
    biggest single reason is one that people often forget:  Threads usually
    'block' and 'wakeup' due to events, and for an event to occur the kernel
    almost always has to be involved to some degree or other.  But there are
    other reasons too.  Distribution of threads across available cpu's,
    for example.

    Remember that it is not the context switch which is the expensive part,
    it's how you scale the event-handling when dealing with a large number
    of resources.

						-Matt





To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message



help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199911242001.MAA20386>