Easiest way to extend CAS (casMutVar#) to boxed/unboxed Vector elements?

Ryan Newton rrnewton at gmail.com
Tue Jan 10 18:19:17 CET 2012

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

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?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/glasgow-haskell-users/attachments/20120110/0dff54e7/attachment.htm>

More information about the Glasgow-haskell-users mailing list