Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!mips!apple!olivea!oliveb!pyramid!octopus!satyr!ditka!zinn!decvax.dec.com!abyss.zk3.dec.com!kenton From: kenton@abyss.zk3.dec.com (Jeff Kenton OSG/UEG) Newsgroups: comp.arch Subject: Re: Atomic operations (Was Re: Living With Old Baggage) Keywords: 68040 CAS2 Message-ID: <1991May6.113149.14531@decvax.dec.com> Date: 6 May 91 11:31:49 GMT References: <336@scorpio.gtephx.UUCP> <12741@pt.cs.cmu.edu> <14628@encore.Encore.COM> <1991Apr22.175410.9840@decvax.dec.com> <1991May2.201917.15062@dg-rtp.dg.com> Sender: usenet@decvax.dec.com (Usenet News System) Reply-To: kenton@abyss.zk3.dec.com (Jeff Kenton OSG/UEG) Organization: Digital Equipment Corporation - Nashua, NH Lines: 24 Nntp-Posting-Host: abyss.zk3.dec.com In article <1991May2.201917.15062@dg-rtp.dg.com>, hamilton@siberia.rtp.dg.com (Eric Hamilton) writes: |> In article <1991Apr22.175410.9840@decvax.dec.com>, kenton@abyss.zk3.dec.com (Jeff Kenton OSG/UEG) writes: |> |> |> |> The 88K has xmem, not test and set, which is guaranteed to be an atomic |> |> operation (the bus is locked between the read and write cycles). This |> |> can be used to create locks or compare and swap without disabling itnerrupts. |> |> |> Now I'm curious. How does one fabricate compare-and-swap out of xmem |> without disabling interrupts? Xmem has essentially the same restriction as |> test-and-set, which is that the stored value must be a constant independent of |> the loaded value. |> Once you've created a lock (with xmem) you can do almost anything within the locked region of code without disabling interrupts. ----------------------------------------------------------------------------- == jeff kenton Consulting at kenton@decvax.dec.com == == (617) 894-4508 (603) 881-0011 == -----------------------------------------------------------------------------