From owner-freebsd-arch Sun Sep 24 11:34:14 2000 Delivered-To: freebsd-arch@freebsd.org Received: from falla.videotron.net (falla.videotron.net [205.151.222.106]) by hub.freebsd.org (Postfix) with ESMTP id D758A37B422; Sun, 24 Sep 2000 11:34:11 -0700 (PDT) Received: from modemcable136.203-201-24.mtl.mc.videotron.ca ([24.201.203.136]) by falla.videotron.net (Sun Internet Mail Server sims.3.5.1999.12.14.10.29.p8) with ESMTP id <0G1E00MDVM8XXY@falla.videotron.net>; Sun, 24 Sep 2000 14:34:10 -0400 (EDT) Date: Sun, 24 Sep 2000 14:37:52 -0400 (EDT) From: Bosko Milekic Subject: Re: need advice, fsetown annoyances and mpsafeness. In-reply-to: <20000924103303.M9141@fw.wintelcom.net> To: Alfred Perlstein Cc: arch@FreeBSD.ORG, cp@FreeBSD.ORG Message-id: MIME-version: 1.0 Content-type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Sun, 24 Sep 2000, Alfred Perlstein wrote: > What it then does is walk through the sigio structs hung from itself > and using a back-pointer that points to the pointer within the > object (socket/tty) it raises splhigh and NULLs it out, lowers spl, > then frees the sigio. > > s = splhigh(); > *(sigio->sio_myref) = NULL; > splx(s); Why can't this be done with an atomic operation? If you're holding the sigio struct, then are you not also ensuring that sigio->sio_myref won't change. Setting the pointer within the object to NULL should be atomic in itself, AFAIK. I'm wondering what would happen if the object is destroyed just before you splhigh() up there (in other words, did you leave something out of the example you posted above?) Assuming something was left out, then I'm wondering if it would be profitable in this case to distinguish between the nature of the object and optionally provide a pointer to a mutex in the sigio struct which should be aquired in order to do this manipulation. > thanks, > -- > -Alfred Perlstein - [bright@wintelcom.net|alfred@freebsd.org] > "I have the heart of a child; I keep it in a jar on my desk." Cheers, Bosko Milekic bmilekic@technokratis.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message