[M3devel] Atomic

Tony Hosking hosking at cs.purdue.edu
Thu Dec 24 01:12:02 CET 2009


Jay, this is Modula-3 not C. We support atomic on the Modula-3  
primitive types. All of the sizes you ask for are supported.  Even  
DCAS for 64-bit on 32-bit I

Sent from my iPhone

On Dec 23, 2009, at 5:50 PM, Jay K <jay.krell at cornell.edu> wrote:

> Can/should we have something like AtomicWordPair or AtomicWordArray2?
>
> TYPE WordPair = RECORD a,b: Word.T END;
> or TYPE WordArray2 = ARRAY[0..1] of Word.T;
>
> Because modern x86 and very modern AMD64 can support  
> Atomic.CompareExchange(WordPair).
>
> I kind of think there should also be AtomicShort or AtomicInt16 for  
> completeness.
> I realize WideChar covers it, but then, char==boolean also, right?
> I forget what BYTESIZE(BOOLEAN) is actually. The obvious candidates  
> are 1 and BYTESIZE(INTEGER) and 4 ("int").
>
> For that matter..there aren't clearly 32bit operations on 64bit  
> platforms (depending upon boolean).
> Which all goes to my earlier repeated point.. Atomic8, Atomic16,  
> Atomic32, Atomic64, Atomic128, AtomicInt = Atomic32 or Atomic64,  
> AtomicLongInt = Atomic64, AtomicWideChar = Atomic16, AtomicBool =  
> Atomic8 or AtomicInt...
>
>  - Jay
>
>
> > Date: Wed, 23 Dec 2009 23:39:13 +0000
> > To: m3commit at elegosoft.com
> > From: hosking at elego.de
> > Subject: [M3commit] CVS Update: cm3
> >
> > CVSROOT: /usr/cvs
> > Changes by: hosking at birch. 09/12/23 23:39:13
> >
> > Added files:
> > cm3/m3-libs/m3core/src/atomic/: Atomic.ig AtomicAddress.i3
> > AtomicBoolean.i3 AtomicChar.i3
> > AtomicInteger.i3
> > AtomicLongint.i3 AtomicRefany.i3
> > AtomicWideChar.i3 AtomicWord.i3
> >
> > Log message:
> > Working up the Atomic interface. Comments welcome.
> > No implementation yet, so don't try using these... you'll get  
> linkage errors.
> > But they do compile. ;-)
> >



More information about the M3devel mailing list