Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chase-Lev queue looks like trouble #65

Open
treeowl opened this issue Jul 20, 2018 · 2 comments
Open

Chase-Lev queue looks like trouble #65

treeowl opened this issue Jul 20, 2018 · 2 comments

Comments

@treeowl
Copy link
Contributor

treeowl commented Jul 20, 2018

Aside from all their other devilish subtleties, it appears to be that Chase-Lev queues don't completely guarantee that left and right pops don't both take the last queue element. If that happens here, I believe two threads could both try to fill the same IVar, in which case the second one will fill the IVar with an exception thunk (and then throw an exception). To fix this, we'd need put_ to take care to leave the IVar value alone when it's full. That's easy enough, but I don't think it's nearly enough: what do we do about the exception? A particularly nasty case involves two IVars, A and B, and two copies of the same thread, P and Q. Suppose P and Q each spawn threads to fill A and B, and those happen to do so in the opposite orders. Then P will die because B is full, and Q will die because A is full. I therefore believe that when Chase-Lev queues are enabled, non-determinism errors should be disabled.

@treeowl
Copy link
Contributor Author

treeowl commented Jul 21, 2018

Hrmm... Maybe I'm wrong... the implementation we use may be stronger than the original paper. This stuff looks extremely subtle.

@simonmar
Copy link
Owner

It is extremely subtle. Perhaps this issue belongs over on the chaselev-deque repo instead?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants