-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
Hi there, on line 206 in steal() you have moved the ->get() call into the CAS if, (as oppose to before like Figure 1. in the reference material). I believe this introduces a bug as:
- Thread A executes a
steal()and hangs just after successfully completing the CAS. - A push occurs, from thread B, that overwrites the stolen item (due to buffer wrap around).
- A wakes up and retrieves the wrong item.
This could be fixed by moving the ->get() before the CAS branch but then a copy must be made for every steal, even the unsuccessful ones :(
Metadata
Metadata
Assignees
Labels
No labels