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 occasionally send you account related emails.
Already on GitHub? Sign in to your account
run-fibers with #:drain #t does not wait for dependent threads #30
Comments
That said, for my usecase, run-fibers does not return, so this issue does not show up. There is a workaround where one can properly manage the life of the threads created with |
Maybe a |
I think in general it's hard to have a general definition of what it means to be done. |
My idea to workaround the above behavior was the change the definitions of
That is what I documented in the previous comment. Thanks for the feedback! 👍 |
When trying to emulate a threadpool for blocking operations (cpu intensive or embedded database like wiredtiger) I hit a bug with
#drain #t
whererun-fibers
returns before the thread created withcall-with-new-thread
has the time the finish itsblock
call insuspend
ofoperations.scm
:fibers/fibers/operations.scm
Lines 148 to 184 in b86405a
Since in the thread, there is no reference to the "parent" scheduler, it is not possible to notify that a thread is waiting/blocking for a operation rendez-vous.
When creating the thread in the fiber, the program hits the issue #21.
Here is a test program:
uncomment
(sleep 10)
to have see the program complete.The text was updated successfully, but these errors were encountered: