Questions tagged [atomic-swap]

22 questions
1
vote
2 answers

How to atomically perform sequential load and store operations?

Consider this code under GCC 4.8.0: std::atomic a; std::atomic b; a.store( b.load() ); // want to be atomic How can I make the line above to be atomic as whole? In other words, how to obtain atomic assignment of atomic variables? Are…
Vahagn
  • 4,670
  • 9
  • 43
  • 72
0
votes
2 answers

Declaration of Volatile Pointer Array in C++

I have a struct called Ambigous, and inside the struct I have an array of pointers to other Ambigous. I want to use OSAtomic.h library, to do CompareandSwaps. However I am having trouble getting the array to play nice. …
Steven Feldman
  • 833
  • 1
  • 15
  • 28
0
votes
1 answer

Cross chain interoperability

I'm looking into chain interoperability on network level (ex Fabric - Corda, Sawtooth - Ethereum, Corda entr - Corda os) and was wondering if there is any more (technical) information/research/demo available regarding this topic. I've done the EdX…
0
votes
1 answer

unsafe.compareAndSwapInt first argument menanig

I am investigating java.util.concurrent.locks.AbstractQueuedSynchronizersource code. From severals place invokes compareAndSetState method. /** * Atomically sets synchronization state to the given updated * value if the current state value equals…
gstackoverflow
  • 36,709
  • 117
  • 359
  • 710
0
votes
1 answer

Atomic instruction : How can other thread update the value while Compare and Swap instruction is in progress?

As per my understanding, any atomic instructions(compare_and_swap, test_and_test, fetch_and_add) are executed as a single instruction. Though they involve multiple CPU cycles/operations, it is invisible to the thread/process. If a thread is…
-1
votes
1 answer

ERC20 atomic swap in solidity

My goal is to create a simple Ethereum smart contract that allows for an atomic swap between tokens. Initially it should've been a cross-chain swap but I am struggling to do the basics. I am using ERC20 tokens that i have created using the…
-1
votes
2 answers

GCC flags for c++0x atomics and threads

I have tried to compile this basic example of C++ atomics & threads though when I got to compile the main.cpp file gcc throws up a few std lib errors - which seem unrelated to my code. main.cpp #include #include #include…
TheBlueCat
  • 1,147
  • 5
  • 19
  • 38
1
2