Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 10 Jan 2002 15:36:01 -0700
From:      Nate Williams <nate@yogotech.com>
To:        Kelly Yancey <kbyanc@posi.net>
Cc:        Alfred Perlstein <bright@mu.org>, Nate Williams <nate@yogotech.com>, Terry Lambert <tlambert2@mindspring.com>, Daniel Eischen <eischen@pcnet1.pcnet.com>, Dan Eischen <eischen@vigrid.com>, Peter Wemm <peter@wemm.org>, Archie Cobbs <archie@dellroad.org>, arch@FreeBSD.ORG
Subject:   Re: Request for review: getcontext, setcontext, etc
Message-ID:  <15422.5969.820708.433083@caddis.yogotech.com>
In-Reply-To: <Pine.BSF.4.21.0201101401420.6961-100000@gateway.posi.net>
References:  <20020110135324.N7984@elvis.mu.org> <Pine.BSF.4.21.0201101401420.6961-100000@gateway.posi.net>

next in thread | previous in thread | raw e-mail | index | archive | help
> > > > I mean if we've got to go to the kernel to switch thread contexts, why
> > > > not just have the kernel track all of the threads and restore context
> > > > once, just for the current thread, rather than twice (once for the
> > > > scheduler and another for the scheduler to switch to the current
> > > > thread context)?
> > > 
> > > For effeciency reasons...
> > 
> > And flexibility as well, but I guess that can be lumped under
> > effeciency.
> > 
> 
>   If the context switch overhead is the same (or worse) with a userland
> scheduler, then what are the "effeciency reasons" for having it?

*IF* it requires a system call/kernel help, then we have no choice.
However, the reason we're spending some much time determining if this
necessary is because of effeciency/flexibility reasons.  If we can do it
in userland, then we should have the option of doing it there.

> Where does the userland scheduler reclaim it's lost ground?  The only
> things my limited understanding can produce are a number of trivial
> data structures that can be moved from the kernel to userland. :/

There is debugging and flexibility to be gained by having it in userland
as well.  You can change the way a particular process wants it's threads
scheduled much easier in a userland scheduler by changing the
algorithm, since it doesn't require a kernel recompile/reboot.  Plus,
each application may want a specific threading algorithm used.

>   Of course, all this moot if userland context switches can be done properly
> without entering the kernel and in a way the preserves flexibility.

Right.

>   As an aside, I cannot find a reference now, but hasn't it been
>   rumoured that > Solaris has dropped it's userland scheduler?

I hadn't heard that.  However, I had heard that they were providing an
alternative thread library that uses a one-one mapping for user/kernel
threads for certain applications.  In this case, there would be no
reason for a userland thread scheduler.  I don't believe this is the
only model they support though...


Nate

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




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