-
Notifications
You must be signed in to change notification settings - Fork 164
Deadlock scenario #185
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occas 8000 ionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
You are using |
The |
But it blocks the entire thread and the coroutines thus can't run. Try deleting it. Or relace it with |
The outcome is really no different. Did you try it ? I don't know how I can explain this better as I already wrote:
Do I expect to much from |
Well, this is your output from above:
It only happens after you press a key because getchar blocks the entire thread. |
The question again is not about that but, why It doesn't print:
The |
Why it doesn't print what? The line of code is:
The printed string is:
That looks OK to me, no? |
I'll try it one more time, putting the question
in kind of a flow diagram. So if
This would print the sequence:
But the actual sequence printed is
This indicates to me either there is a bug in libdill or that |
You should make no assumptions about how scheduler schedules coroutines. After message is passed between coroutines, both sending coroutine and receiving coroutine are free to continue. Scheduler will pick one of them. You can't know which one in advance. |
But does a I wrote my own I wonder if doing this with libdill is a good idea and if I shouldn't roll my own stuff based on deboost.context or something to get the reliability (and speed) I need. After all I just don't need much... |
No, you can't rely on scheduler working in a deterministic manner. Also, dill_trigger is an internal function and shouldn't be used from outside. As for deboost, I have no experience with it, so I can't tell. |
Ok thanks for the help. |
I am making this an own issue from the other thread, because I think this is a bug. If this is intentional behaviour it'd be interesting to know. I reduced my test case even more, to make it more understandable and the problem more prominent.
This is the input/output. (The empty line is me pressing RETURN for
getchar
)It is clear that the
chread
is not triggered duringchsend
. This is curious because there is adill_trigger
indill_chsend
to wake up channel readers presumably, but it does not seem to do its job. Thechdone
doesn't trigger thechread
either. But thebundle_wait
eventually does.The text was updated successfully, but these errors were encountered: