[M3commit] CVS Update: cm3

Antony Hosking hosking at elego.de
Tue Feb 17 05:45:48 CET 2009


CVSROOT:	/usr/cvs
Changes by:	hosking at birch.	09/02/17 05:45:48

Modified files:
	cm3/m3-sys/m3front/src/builtinOps/: BuiltinOps.m3 m3makefile 
	cm3/m3-sys/m3front/src/misc/: CG.i3 CG.m3 Token.m3 
	cm3/m3-sys/m3front/src/values/: Formal.i3 Formal.m3 
Added files:
	cm3/m3-sys/m3front/src/builtinOps/: Cas.i3 Cas.m3 CasP.i3 
	                                    CasP.m3 

Log message:
	Experimental support for compare_and_swap (CAS) and compare_and_set (CASP) builtin operations.
	CAS is defined as follows:
	
	CAS(v, o, n): BaseType(v)
	
	where v is an integer variable (INTEGER/LONGINT), and o and n are assignable to v,
	atomically sets v to value n, so long as the previous value of v is o, returning the previous
	value of v in either case.
	
	Similarly, CASP is defined as:
	
	CASP(v, o, n): BOOLEAN
	
	atomically sets v to n, so long as the previous value of v is o, returning TRUE if the
	comparison is successful and n was assigned to v.
	
	I may yet generalize these to permit v to have any ordinal type.
	In unsafe modules I may also permit v to be a subtype of ADDRESS.




More information about the M3commit mailing list