bfeb6047d95e375dad204e6779e1212117f915b5
[cdsspec-compiler.git] / benchmark / chase-lev-deque-bugfix / note.txt
1 #1: Ordering point of the deque as the following: 
2
3 First of all, the normal usage scenario of the deque is that the main thread
4 calls push() or take() to add or remove elements into the deque from the bottom
5 (at the same side) while other independent threads call steal() to remove
6 elements from the top (at the other side). Thus intuitively, we use the store of
7 the Bottom as the ordering point of push(). For take() and steal(), when there's
8 no race between them, meaning that there are more than one element, we also use
9 the load of Bottom as their ordering points. However, when take() has to remove
10 an preemptively, it will use a CAS to update the Top to race with other stealing
11 threads. Thus, in that case, we have additional ordering points at the CAS/Load
12 (when failure happens) to order the steal() and the take().