a larger suite of cas primitive types would be really nice
Currently it is hard to write portable code for lock-free and wait-free algorithms using casIntArray#
without either wasting a lot of space or dealing with heavily platform specific results.
Int#
has a size that is inherently tied to the current architecture's pointer width.
I'd like to be able to casInt8Array#
, casInt16Array#
,casInt32Array#
, casInt64Array#
, etc to write more general container types.
We similarly have atomicCasWordAddr#
and atomicCasAddrAddr#
, but nothing for any other sizes.
Is there an architecture that we support in the NCG that just doesn't support finer grained CAS?
On Intel, I'd also really like to be able to invoke the "double-width" CAS operations that are available as cmpxchg16b
on 64 bit architectures and cmpxchg8b
on 32 bit architectures somehow as there are many lock-free algorithms that cannot be efficiently implemented without them. (Not to be confused with "DCAS".)