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
I have an interprocesscondition variable to sync my processes, there is one notifier that notify and two waiters that timed_wait for notification or timeout.
If one of the waiters crashes and restarts, the three processes are blocked.
The way to fix it is to kill them, delete the shared memory, and restart them.
On a normal run, everything works as expected, and when one waiter crashes (non-boost related issues) and restarts the three processes are blocked on the condition variable, notifier blocked on notify, first waiter blocked on timed_wait, crashed waiter blocked on mutex lock.
In case the notifier is up but not in the while loop yet, the waiters can crash and restart, and the behavior of waiting until timeout will continue, but when the notifier enters the while loop and notify the three of them get stuck, notifier block on notify, first waiter block on timed_wait, crashed waiter block on mutex lock.
It happened just when I crashed one of the waiters when it blocked on timed_wait, not when I crashed the notifier.
The text was updated successfully, but these errors were encountered:
one notifier and some waiter, when terminate a waiter, then the notifier and others all blocking.
i want use named_condition to sync process, but meet this question, and i don't konw how to solve it.
See: Stack overflow question
I have an
interprocess
condition variable
to sync my processes, there is onenotifier
thatnotify
and twowaiters
thattimed_wait
fornotification
ortimeout
.If one of the
waiters
crashes and restarts, the three processes are blocked.The way to fix it is to kill them, delete the shared memory, and restart them.
Processes sync shared memory class:
First process
notifier
:Second/Third processes
waiters
:Boost version
1.78.0
Linux
Ubuntu 18.04.5 LTS
Arch
aarch64
On a normal run, everything works as expected, and when one
waiter
crashes (non-boost related issues) and restarts the three processes are blocked on thecondition variable
,notifier
blocked onnotify
, firstwaiter
blocked ontimed_wait
, crashedwaiter
blocked onmutex lock
.In case the
notifier
is up but not in the while loop yet, thewaiters
can crash and restart, and the behavior of waiting until timeout will continue, but when thenotifier
enters the while loop andnotify
the three of them get stuck,notifier
block onnotify
, firstwaiter
block ontimed_wait
, crashed waiter block onmutex lock
.It happened just when I crashed one of the
waiters
when it blocked ontimed_wait
, not when I crashed thenotifier
.The text was updated successfully, but these errors were encountered: