From owner-freebsd-threads@FreeBSD.ORG Fri Feb 20 11:48:27 2004 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C06DF16A4CE for ; Fri, 20 Feb 2004 11:48:27 -0800 (PST) Received: from sccrmhc11.comcast.net (sccrmhc11.comcast.net [204.127.202.55]) by mx1.FreeBSD.org (Postfix) with ESMTP id 87B9243D1F for ; Fri, 20 Feb 2004 11:48:27 -0800 (PST) (envelope-from julian@elischer.org) Received: from interjet.elischer.org ([24.7.73.28]) by comcast.net (sccrmhc11) with ESMTP id <200402201948260110092cuke>; Fri, 20 Feb 2004 19:48:26 +0000 Received: from localhost (localhost.elischer.org [127.0.0.1]) by InterJet.elischer.org (8.9.1a/8.9.1) with ESMTP id LAA24272; Fri, 20 Feb 2004 11:48:25 -0800 (PST) Date: Fri, 20 Feb 2004 11:48:24 -0800 (PST) From: Julian Elischer To: Dag-Erling =?iso-8859-1?q?Sm=F8rgrav?= In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=X-UNKNOWN Content-Transfer-Encoding: QUOTED-PRINTABLE cc: threads@freebsd.org Subject: Re: cross-thread locking X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Feb 2004 19:48:27 -0000 On Fri, 20 Feb 2004, Dag-Erling [iso-8859-1] Sm=F8rgrav wrote: > - What happens when a thread locks a mutex and then starts another > thread? Does the new thread in any way inherit the lock, or will it > have to acquire its own? do you mean userland mutexes or kernel mutexes? I'll only cover kernel mutexes.. In KSE the new thread in teh kernel does not start out in the same context as the parent thread.. in this way it is not like fork(). the new thread starts out about to return to user land pretty much as if it has just completed a special system call. this return-without-having-done-the-call-in-the-first-place is called an upcall. The upcall is into the userland thread scheduler and a new userland thread is jumped into in userland.. the original thread is still blocked or running in the kernel and still owns the mutex. >=20 > - What about spin locks? Are there any semantic differences between > mutexes and spin locks in POSIX, or are spin locks simply mutexes > that spin instead of sleeping? >=20 > DES > --=20 > Dag-Erling Sm=F8rgrav - des@des.no > _______________________________________________ > freebsd-threads@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-threads > To unsubscribe, send any mail to "freebsd-threads-unsubscribe@freebsd.org= " >=20