Questions tagged [double-compare-and-swap]

Atomic primitive proposed to support certain concurrent programming techniques. DCAS takes two not necessarily contiguous memory locations and writes new values into them only if they match pre-supplied "expected" values.

4 questions
1
vote
0 answers

Atomic swap for smart pointers on x86/x86-64

Is it possible to implement atomic swap for smart pointers on x86/x86-64 without using of transactional memory. Especially interested in atomic exchange for shared_ptr. There are CMPXCHG8B and CMPXCHG16B instructions on modern processors. Can they…
Tomilov Anatoliy
  • 15,657
  • 10
  • 64
  • 169
1
vote
0 answers

Does 32-bit mips cmpxchg(cas) support 8 Bytes?

everyone. I am writing a program in 32-bit mips using double words to avoid ABA problem. But it seems that 32-bit mips does not support 8 Bytes in Linux kernel source code. If so, is there anybody knowing 8 Bytes extension? Are there other ways to…
0
votes
1 answer

Does Java support double-width CAS?

Is there a way to perform a double-width (16-byte) compare-and-swap in Java if the hardware supports it (e.g. using CMPXCHG16B on Intel)?
galym
  • 133
  • 4
0
votes
1 answer

Can anybody help me with atomicmin function syntax for cuda?

I am unable to get a proper syntax for using atomicMin. I would like to use this function to operate on double rather than integer. __global__ void npd(int *a, int *g) { int index = threadIdx.x; __shared__ int…