Skip to content
This repository has been archived by the owner on Jan 9, 2018. It is now read-only.

Race condition in Promise #42

Closed
trumpetinc opened this issue Aug 4, 2014 · 0 comments
Closed

Race condition in Promise #42

trumpetinc opened this issue Aug 4, 2014 · 0 comments

Comments

@trumpetinc
Copy link
Collaborator

The Promise class needs the get() method to check to see if the value has already been set BEFORE calling wait(). If no thread is waiting when the other thread calls calls notifyAll(), then it's a NOP and the wait()ing thread will wait forever. Classic race condition. I sometimes see an RPC call that waits forever because the response comes back faster than the client thread can call enter get() and call wait().

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

No branches or pull requests

1 participant