🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: bit.listserv.asm370
Article #1552

Strange use of compare-and-swap

#1552
From: John A. Pershing Jr. (+1 914) 78...
Date: Fri, 26 Jun 1992 13:47
21 lines
1726 bytes
    Date:         Thu, 25 Jun 1992 21:58:47 GMT
    From:         Valdis Kletnieks <vtserf!vttcf.cc.vt.edu!valdis@UUNET.UU.NET>
    Consider what happens if your single ST manages to collide with a
    CS being done elsewhere at the same time.  Kind of defeats the
    purpose doesn't it?

Not at all.  What happens is that the CS "fails", since it notices that
the word is storage is no longer equal to the first operand.  So, it
loads the first operand with the "new" value from storage and yields a
condition code of 1, causing the CPU doing the incrementing to go
around the loop another time.

To correct your claim...

In general, it's ALWAYS safe to store into a shared memory location
without a mutex lock of some sort as long as (1) you don't care what
value was there before your STORE, and (2) your STORE access is block-
concurrent (e.g., a fullword STORE into an aligned fullword).

      John Pershing
      IBM Research, Yorktown Heights, NY
Technical Details
Message-ID: <ASM370%92062609562271@OHSTVMA.IRCC.OHIO-STATE.EDU>
Path: arc1-ca.pugleaf.net!sparky!uunet!paladin.american.edu!auvm!YKTVMH.BITNET!PERSHNG

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: fcdcb,15f3a5e3decac54e,start
X-Google-Attributes: gidfcdcb,public
X-Google-ArrivalTime: 1992-06-25 19:08:56 PST
Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU
Path: arc1-ca.pugleaf.net!sparky!uunet!paladin.american.edu!auvm!YKTVMH.BITNET!PERSHNG
Message-ID: <ASM370%92062609562271@OHSTVMA.IRCC.OHIO-STATE.EDU>
Newsgroups: bit.listserv.asm370
Date:         Fri, 26 Jun 1992 09:47:13 EDT
Sender:       IBM 370 Assembly Programming Discussion List <ASM370@UGA.BITNET>
Comments:     In-Reply-To: Posting to IBM-MAIN dated Thu,
              25 Jun 1992 21:58:47 GMT
From:         "John A. Pershing Jr. (+1 914) 784-7167" <PERSHNG@YKTVMH.BITNET>
Subject:      Strange use of compare-and-swap
Lines: 21