libpthread patch

Daniel Eischen eischen at pcnet1.pcnet.com
Thu Apr 17 02:24:42 PDT 2003


On Thu, 17 Apr 2003, Terry Lambert wrote:

> Daniel Eischen wrote:
> > The critical section is to prevent the thread from being
> > swapped out by the kernel and sent to another KSE.  That's
> > it; it's not meant to do the same thing as locking.
> > There's per-kse stuff that needs to be accessed that
> > isn't correct if the thread gets run on another KSE,
> > regardless of whether or not a lock protects it.
> 
> I guess the next question is why thread-lending (ala NT,
> MACH, etc.) isn't supportable.

It might still be possible; it's just not as easy.

> > If it wasn't possible for the kernel to send completed
> > threads from one KSE to another (within the same KSE
> > group), we probably wouldn't need critical sections
> > (at least as currently implemented).
> 
> Is there a particular performance/other reason this is allowed?

I dunno.  The original Jasone Evans paper didn't allow this, but
the Anderson SA paper did (although our version of KSE's is a bit
different than SA).

-- 
Dan Eischen



More information about the freebsd-threads mailing list