Closed jpfairbanks closed 7 years ago
I think the
function atomic_cas!(x::Array{T}, i::Int, cmp::T, new::T) ptr = pointer(x) + i*sizof(T) llvmcall($""" %rs = cmpxchg $lt* %0, $lt %1, $lt %2 acq_rel acquire %rv = extractvalue { $lt, i1 } %rs, 0 ret $lt %rv """, $typ, Tuple{Ptr{$typ},$typ,$typ}, ptr, cmp, new) end
stuff would be a really great contribution to base julia.
See UnsafeAtomics.jl as a starting point for this.
I think the
stuff would be a really great contribution to base julia.