[M3devel] atomic operations in cm3

Jay K jay.krell at cornell.edu
Mon Feb 27 01:37:56 CET 2012


  > Look in m3-libs/m3core/src/atomic/m3makefile for a record of what I found.
 http://dcvs.elegosoft.com/cgi-bin/cvsweb.cgi/cm3/m3-libs/m3core/src/atomic/m3makefile?rev=1.14;content-type=text%2Fplain confusing, but goodness:
 Almost anything anyone would want is supported. 
 Except for ARMEL_LINUX: 
All targets support atomic INTEGER and REFANY. 
All LINUX targets support atomic for all types (8/16/32/64). 
All I386 targets support atomic for all types (8/16/32/64).
  This includes NT386 and probably I386_NT/I386_CYGWIN/I386_INTERIX. 
All 64bit targets support atomic for LONGINT (64).
 The missing stuff is generally in unfinished or unused targets.
PPC_DARWIN missing atomic LONGINT is the most glaring omission.
SPARc32_LINUX is next -- it should work as well as SPARc32_SOLARIS/SOLsun/SOLnu.  
Where not supported, there is pattern where you fallback to using a LOCK.I'd venture a guess that PA{32,64}_{HPUX,LINUX} also don't have good atomic support. 


 > I checked in a test case. Can you look at it?  http://dcvs.elegosoft.com/cgi-bin/cvsweb.cgi/cm3/m3-sys/m3tests/src/m3makefile?rev=1.105;content-type=text%2Fplain  => look for "atomic"  => http://dcvs.elegosoft.com/cgi-bin/cvsweb.cgi/cm3/m3-sys/m3tests/src/p2/p226/Main.m3?rev=1.10;content-type=text%2Fplain Shows how to use it all. It is disabled. Let's try it.. 
 - JayFrom: jay.krell at cornell.edu
To: dragisha at m3w.org; m3devel at elegosoft.com
Subject: RE: [M3devel] atomic operations in cm3
Date: Sat, 25 Feb 2012 02:24:14 +0000







I checked in a test case. Can you look at it?
Yes it is possible.
 
 
I forget the details, but some operations do require locks on some targets.
There is an interface to determine if the target supports lock-free operation.
 
 
As long as you are only dealing in INTEGER or REFANY, I think you are ok across the board.
 
 
Some 32bit targets don't support 64bit atomtic, like Powerpc.
SPARC32 and x86 have supported 64bit atomic operations for a long time.
    Linux and Solaris kernels don't run on 32bit SPARC any longer, so 64bit instructions are available in 32bit usermode.
HPPA is problematic for all atomics I recall. The instruction set support is very limited.
Linux has good support somehow, something dependent on the kernel, but I don't know what gcc/HP-UX/OpenBSD/NetBSD story is.
 
 
Look in m3-libs/m3core/src/atomic/m3makefile for a record of what I found.
 
 
And ask Bing.
 
 
 - Jay
 
> From: dragisha at m3w.org
> Date: Fri, 24 Feb 2012 21:27:13 +0100
> To: m3devel at elegosoft.com
> Subject: [M3devel] atomic operations in cm3
> 
> I cannot find any hint on how to make use of <subject>. What would I like is to communicate with worker threads without LOCK… Possible?
> 
> TIA,
> dd
> 
 		 	   		   		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://m3lists.elegosoft.com/pipermail/m3devel/attachments/20120227/a0cba8a9/attachment-0002.html>


More information about the M3devel mailing list