You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Current Python.org docs for multiprocessing.Event link directly to threading.Event
The documents for threading.Event.wait read (emphasis mine)
This method returns True if and only if the internal flag has been set to true, either before the wait call or after the wait starts, so it will always return True except if a timeout is given and the operation times out.
It appears that a race condition exists in the multiprocessing implementation but not in the threading implementation.
If we implement a child process that just does a set/clear on an event over and over (as a heartbeat), then in the parent process do a wait() on that event (with extremely long timeout), we would expect to never see a timeout.
I've attached the proof of concept below showing how both threading.Event and multiprocessing.Event yield different results.
Current Python.org docs for
multiprocessing.Event
link directly tothreading.Event
The documents for
threading.Event.wait
read (emphasis mine)It appears that a race condition exists in the multiprocessing implementation but not in the threading implementation.
If we implement a child process that just does a set/clear on an event over and over (as a heartbeat), then in the parent process do a wait() on that event (with extremely long timeout), we would expect to never see a timeout.
I've attached the proof of concept below showing how both threading.Event and multiprocessing.Event yield different results.
Possible cousin bug: #85772
Observed on:
The text was updated successfully, but these errors were encountered: