@@ -172,7 +172,7 @@ fn resize(&self, cap_new) {
172
172
'L308 : guard . defer (move || old . into_owned ());
173
173
}
174
174
175
- pub fn steal (& self ) -> Retry <T > {
175
+ pub fn steal (& self ) -> Steal <T > {
176
176
'L401 : let mut t = self . top. load (Relaxed );
177
177
178
178
'L402 : let guard = epoch :: pin_fence (); // epoch::pin(), but issue fence(SeqCst) even if it is re-entering
@@ -183,13 +183,12 @@ pub fn steal(&self) -> Retry<T> {
183
183
'L405 : let buffer = self . buffer. load (Acquire , & guard );
184
184
'L406 : let value = buffer . read (t % buffer . get_capacity (), Relaxed );
185
185
186
- 'L407 : match self . top. compare_and_swap_weak (t , t + 1 , Release ) {
187
- 'L408 : Ok (_ ) => return Data (value ),
188
- 'L409 : Err (t_old ) => {
189
- 'L410 : mem :: forget (value );
190
- 'L411 : return Retry ;
191
- 'L412 : }
192
- 'L413 : }
186
+ 'L407 : if self . top. compare_and_swap_weak (t , t + 1 , Release , Relaxed ). is_err () {
187
+ 'L408 : mem :: forget (value );
188
+ 'L409 : return Retry ;
189
+ 'L410 : }
190
+
191
+ 'L411 : Data (value )
193
192
}
194
193
```
195
194
@@ -737,7 +736,7 @@ each case of `I_i`.
737
736
write to ` bottom ` at ` 'L110 ` to ` I_i ` 's read from ` bottom ` at ` 'L403 ` . Thus we have ` w <= y `
738
737
because ` I_i ` reads ` top = y ` once more at ` 'L407 ` , ` WB_(l+1) ` is coherence-after-or ` WB_(k+1) ` ,
739
738
and the value ` v ` that ` O_k ` wrote to the buffer at ` 'L109 ` should be acknowledged by ` I_i ` at
740
- ` 'L409 ` . Also, we have ` view_beginning(O_k) <= view_end(I_i) ` , as required by ` (SYNC) ` .
739
+ ` 'L406 ` . Also, we have ` view_beginning(O_k) <= view_end(I_i) ` , as required by ` (SYNC) ` .
741
740
742
741
+ Case ` l <= k ` .
743
742
@@ -989,17 +988,17 @@ follows:
989
988
- ` 'L102 ` can be just plain load: ` 'L109 ` is the only synchronization target, and they have RW ctrl
990
989
dependency.
991
990
992
- - ` 'L408 ` can be just plain load: ` 'L409 ` is the only synchronization target, and they have RR addr
991
+ - ` 'L405 ` can be just plain load: ` 'L406 ` is the only synchronization target, and they have RR addr
993
992
dependency. In an ideal world, this synchronizing dependency should be expressible in C11 using
994
993
the ` Consume ` ordering.
995
994
996
- - ` 'L404 ` can be just plain load, but ` isync/isb ` should be inserted right before ` 'L408 ` : ` 'L408 ` 's
997
- read, ` 'L409 ` 's read, ` 'L407 ` 's read/write, and the end view of ` steal() ` in the successful case
995
+ - ` 'L404 ` can be just plain load, but ` isync/isb ` should be inserted right before ` 'L405 ` : ` 'L405 ` 's
996
+ read, ` 'L406 ` 's read, ` 'L407 ` 's read/write, and the end view of ` steal() ` in the successful case
998
997
are the synchronization targets, and they have RR/RW ctrl+` isync/isb ` dependency.
999
998
1000
999
We believe [ this paper] [ chase-lev-weak ] has a bug in their ARMv7 implementation of Chase-Lev
1001
1000
deque. Roughly speaking, they used a plain load for ` 'L404 ` , and put ctrl+` isync/isb ` right after
1002
- ` 'L409 ` . But in that case, the reads at ` 'L405-'L406 ` can be reordered before ` 'L404 ` . See
1001
+ ` 'L406 ` . But in that case, the reads at ` 'L405-'L406 ` can be reordered before ` 'L404 ` . See
1003
1002
the [ this tutorial] [ arm-power ] §4.2 on [ the MP+dmb+ctrl litmus test] [ mp+dmb+ctrl ] for more
1004
1003
details.
1005
1004
0 commit comments