Date: Wed, 30 Jan 2008 17:09:17 -0500 (EST) From: Daniel Eischen <eischen@vigrid.com> To: Julian Elischer <julian@elischer.org> Cc: freebsd-threads@freebsd.org Subject: Re: threads/119920: fork broken in libpthread Message-ID: <Pine.GSO.4.64.0801301706010.18132@sea.ntplx.net> In-Reply-To: <47A0D2DE.9060005@elischer.org> References: <200801240850.m0O8o2JQ023500@freefall.freebsd.org> <4798564B.7070500@elischer.org> <Pine.GSO.4.64.0801240957550.16059@sea.ntplx.net> <488DBC6A-CF33-4E50-B1BB-C396C8957F92@bikemonkey.org> <Pine.GSO.4.64.0801291611130.12689@sea.ntplx.net> <892A73B3-0114-4718-ABC0-CADD45D9D0FA@bikemonkey.org> <Pine.GSO.4.64.0801292320260.15096@sea.ntplx.net> <D3DFD2DE-E6A3-4373-AC37-42C3CAB9B963@bikemonkey.org> <47A0D2DE.9060005@elischer.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.GSO.4.64.0801301706010.18132>