Path: utzoo!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!aplcen!samsung!cs.utexas.edu!sun-barr!newstop!sun!snafu!lm From: lm@snafu.Sun.COM (Larry McVoy) Newsgroups: comp.arch Subject: Re: Semaphores without Test&Set instruction Message-ID: <132359@sun.Eng.Sun.COM> Date: 1 Mar 90 01:11:28 GMT References: <1990Feb28.014717.16596@indetech.com> Sender: news@sun.Eng.Sun.COM Reply-To: lm@sun.UUCP (Larry McVoy) Organization: Sun Microsystems, Mountain View Lines: 18 In article <1990Feb28.014717.16596@indetech.com> david@indetech.com (David Kuder) writes: >Some while ago there was some discussion in this news group >about implementing semaphores on machines that did not have >an atomic test and set instruction. I read the discussion >with some interest but since I had no need for the >algorithm it went into the bit-bucket. I missed the discussion, so maybe this has been pointed out already: be careful of using an algorithm that depends on the order of memory stores (like Dekker's). Current and future machines have this nasty habit of reordering the stores w/o your knowledge. They typically provide some way for you to say "flush everything before letting the next store go out" but they don't (can't) detect when you need this and do it for you. --- What I say is my opinion. I am not paid to speak for Sun, I'm paid to hack. Besides, I frequently read news when I'm drjhgunghc, err, um, drunk. Larry McVoy, Sun Microsystems (415) 336-7627 ...!sun!lm or lm@sun.com