-
Notifications
You must be signed in to change notification settings - Fork 37
Description
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.