Closed Amanieu closed 8 years ago
Thanks for taking care of this, @Amanieu! :blush: I think it was quite obvious that you're a lot more experienced in the usage of atomics than me.
P.S.: I'll make sure to catch up to you soon. :smile:
@kinghajj Any chance of merging this?
This PR fixes #8 by using relaxed atomics based on this paper: http://www.di.ens.fr/~zappa/readings/ppopp13.pdf
The implementation is based on this one for C++11: https://github.com/Amanieu/asyncplusplus/blob/master/src/work_steal_queue.h
There are several major changes:
top
andbottom
indices by using wrapping operations.Worker
is no longerSync
, since it can only be accessed by one thread at a time.