From owner-freebsd-hackers Tue Aug 15 9:13:38 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from wall.polstra.com (rtrwan160.accessone.com [206.213.115.74]) by hub.freebsd.org (Postfix) with ESMTP id 946E837B815 for ; Tue, 15 Aug 2000 09:13:33 -0700 (PDT) (envelope-from jdp@polstra.com) Received: from vashon.polstra.com (vashon.polstra.com [206.213.73.13]) by wall.polstra.com (8.9.3/8.9.3) with ESMTP id JAA16425; Tue, 15 Aug 2000 09:13:29 -0700 (PDT) (envelope-from jdp@polstra.com) From: John Polstra Received: (from jdp@localhost) by vashon.polstra.com (8.9.3/8.9.1) id JAA04129; Tue, 15 Aug 2000 09:13:28 -0700 (PDT) (envelope-from jdp@polstra.com) Date: Tue, 15 Aug 2000 09:13:28 -0700 (PDT) Message-Id: <200008151613.JAA04129@vashon.polstra.com> To: hackers@freebsd.org Cc: jonas.bulow@servicefactory.se Subject: Re: IPC, shared memory, syncronization AND threads... In-Reply-To: <3997BD3E.2B65AD19@servicefactory.se> References: <39943C37.76D2DBCC@servicefactory.se> <3995431A.324F8C89@servicefactory.se> <200008121639.JAA63479@vashon.polstra.com> <3997BD3E.2B65AD19@servicefactory.se> Organization: Polstra & Co., Seattle, WA Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG In article <3997BD3E.2B65AD19@servicefactory.se>, Jonas Bulow wrote: > John Polstra wrote: > > > I think the ideal solution would first try to lock the > > test-and-set lock, maybe spinning on it just a few times. If that > > failed it would fall back to using a system-call lock such as > > flock() which would allow the process to block without spinning. > > But I don't have any code to do that. (If you write some, could I > > have a copy?) > > I am about to. Actually I thought about this some more, and I'm not all that sure it's possible. I haven't actually _tried_ it, but I think you'd end up needing a low-level mutex around parts of the code. That would have to be implemented as a spinlock, which is exactly what we're trying to avoid in this exercise. > don't know it it's bad design to have rtld.c export > lockdflt_init in the same way as dlopen, what di you think? Right, bad design. :-) John -- John Polstra jdp@polstra.com John D. Polstra & Co., Inc. Seattle, Washington USA "Disappointment is a good sign of basic intelligence." -- Chögyam Trungpa To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message