Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 24 Sep 2000 14:37:52 -0400 (EDT)
From:      Bosko Milekic <bmilekic@technokratis.com>
To:        Alfred Perlstein <bright@wintelcom.net>
Cc:        arch@FreeBSD.ORG, cp@FreeBSD.ORG
Subject:   Re: need advice, fsetown annoyances and mpsafeness.
Message-ID:  <Pine.BSF.4.21.0009241420280.14398-100000@jehovah.technokratis.com>
In-Reply-To: <20000924103303.M9141@fw.wintelcom.net>

next in thread | previous in thread | raw e-mail | index | archive | help


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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0009241420280.14398-100000>