Quantcast
Channel: Atomic swap in C - Stack Overflow
Browsing latest articles
Browse All 3 View Live

Answer by Gabriel Staples for Atomic swap in C

I think this is worth presenting up front. This spin lock approach I'm about to present is valid and correct, but it is also scheduler-unaware, meaning that it won't cooperate with the scheduler like a...

View Article



Answer by Jens Gustedt for Atomic swap in C

It depends a bit on your architecture, what is effectively and efficiently possible. In any case you would need that the two pointers that you want to swap be adjacent in memory, the easiest that you...

View Article

Atomic swap in C

I think I'm missing something obvious here. I have code like this:int *a = <some_address>;int *b = <another_address>;// ...// desired atomic swap of addresses a and b hereint *tmp = a;a =...

View Article
Browsing latest articles
Browse All 3 View Live




Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>
<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596344.js" async> </script>