-
Notifications
You must be signed in to change notification settings - Fork 32
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
(Probably) current-read-writer / current-write-waiter becomes invalid in new (non-fibers) threads spawned from within a fiber #105
Comments
It affects guile-ares-rs, when using with Guix or other code, dealing with non-blocking sockets, because evaluation thread is get spawned from fibers handling incomming nREPL requests: |
This is done to workaround fibers issue: wingo/fibers#105 Fixes: https://todo.sr.ht/~abcdw/tickets/7
It is somehow related to dynamic-state, if I try to create a socket in dynamic state captured before fibers setup, it works well: (define-public (create-socket-in-thread-in-fiber)
(let ((ds (current-dynamic-state)))
(run-fibers
(lambda ()
(define th
(call-with-new-thread
(lambda ()
(with-dynamic-state
ds
create-socket))))
(join-thread th))))) Or I can create a whole thread in dynamic extend captured outside of fibers, it will also work. |
In ``fibers.scm` there is a comment
Could you test setting Assuming this is correct, first Likewise, Some text could be added to the manual that mentions this error message, and in case of (*) doing (define default (current-read-waiter)) is not a proper solution, since whoever is loading the module might have set |
I've adjusted title to what I think is going on. I don't think it's about sockets per se. |
I create a non-blocking socket inside the thread spawned inside the fiber with the following code:
and I receive
Expected behavior is to get
Connection refused
or succesfully connect if another socket on target port is listening.The text was updated successfully, but these errors were encountered: