threads/119920: fork broken in libpthread

Daniel Eischen eischen at vigrid.com
Wed Jan 30 14:09:22 PST 2008


On Wed, 30 Jan 2008, Julian Elischer wrote:

> Landon Fuller wrote:
>> 
>> Is my assumption that kse_critical_enter() prevents any other code from 
>> being run during the critical section incorrect?
>
> My understanding (not being a userland expert) is that
> critical-enter sets a flag in the thread's mailbox telling the
> kernel that no matter what happens, it must not allow another
> thread to pre-empt this one. This means that any system call
> (or page fault or whatever) will be handled synchronously. if
> it blocks, that schedulable entity will block and no upcall
> will be made to schedule another thread.
>
> It does not in any way however ensure that any other thread changes its 
> behaviour.
> Dan, is my understanding correct?

Right, it doesn't prevent another KSE from getting an upcall
and doing things to threads.

The problem seems to be in src/libpthread/sys/lock.c.
See the patch here:

   http://people.freebsd.org/~deischen/kse/libpthread.6.diffs

It is an attempt to merge in all of HEAD to 6.x.  I can't
test it, but it compiles.  You at least want the part of
the patchset that patches sys/lock.c (along with the previous
patch I posted which is also included in the patchset).

-- 
DE


More information about the freebsd-threads mailing list