Speed up trace mode (GSoC Project)
1999mihir.luthra at gmail.com
Wed May 1 06:27:14 UTC 2019
For making my implementation of shared memory data structure more space
efficient, I was trying to implement a stack which stores offsets to unused
locations in the shared memory file. But as stack is being shared it also
needs to be edited in a lock free way. While editing stack I need to
atomically CAS both top of stack and the element on it. For this I found
double compare and swap. Also, in my data structure at one point I need
DCAS as well to ensure correct editing.
To implement DCAS I came across some instruction “cmpxchg16”. But I think
its still not as per my need. 
Do you know any alternative with which I can DCAS atomically or anything
which atomically checks 2 old values before replacing value at an address?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the macports-dev