
10 Jan
2012
10 Jan
'12
5:19 p.m.
Hello there, I was wondering what the recommendations would be for getting CAS on [mutable] vector elements? I thought that as a first step I might create an a library that does the trick only for unboxed vectors, by using bits-atomic (i.e. FFI + GCC intrinsics). Roman Leshchinskiy recommended against depending on GCC. He thought, therefore, that not only boxed arrays but unboxed ones would need an extra PrimOp to be handled properly:
You can't rely on gcc extensions because code is usually compiled with the native code generator nowadays and doesn't go through gcc. The dependency on gcc will (hopefully) be dropped eventually anyway. So you'd probably also want primops for unboxed arrrays and Addr#.
Any advice? Thanks, -Ryan