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
## If it's the last theft attempt per emitted steal requests
## - if we are the lead thread, we know that every other threads are idle/waiting for work
## but there is none --> termination
## - if we are a worker thread, we message our parent and
## passively wait for it to send us work or tell us to shutdown.
ifmyID() ==LeaderID:
detectTermination()
forget(req)
else:
req.state =Waiting
debugTermination:
log("Worker %2d: sends state passively WAITING to its parent worker %d\n", myID(), myWorker().parent)
sendShare(req)
ascertain: notmyWorker().isWaiting
myWorker().isWaiting =true
myParking().wait() # Thread is blocked here until woken up.
The child sends the steal request and then goes idle
But what if the parent checks the steal request and sends a signal to wakeup to the child before it has time to actually sleep, for example to signal termination:
There seems to be a race condition here:
weave/weave/thieves.nim
Lines 187 to 204 in 42b0f80
The child sends the steal request and then goes idle
But what if the parent checks the steal request and sends a signal to wakeup to the child before it has time to actually sleep, for example to signal termination:
weave/weave/signals.nim
Lines 42 to 56 in 42b0f80
The parent exits, is deadlocked at the exit barrier and the child worker is deadlocked sleeping forever.
The text was updated successfully, but these errors were encountered: