-
Notifications
You must be signed in to change notification settings - Fork 29
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
Support spawn multiprocessing context #18
Comments
Thank you for reporting. Haven't tried 'spawn' context before. |
I think I might have fixed it. Just a weird issue with the pickler, one of the fields of the Queue object could not be pickled. I changed the code slightly and it works now. Please clone the latest version and install manually with https://github.com/alex-petrenko/faster-fifo#manual-build-instructions |
@vwxyzjn I believe this should be fixed now in the last version in pip |
I still got the following error when using multiprocessing
|
@Xudong-Huang sorry to hear that! Are you building yours from sources or installing with pip? |
@Xudong-Huang sorry it took so long. I got to it and found what the problem was and why I wasn't able to reproduce it. It's pretty stupid in hindsight because the error is very telling. For some reason multiprocessing.ForkingPickler is not able to pickle the ubyte array that we use to receive messages. I wasn't able to reproduce this because this array is allocated only when we receive the first message. So if we create an empty queue it will be pickled just fine, but a queue that received at least one message will throw this error. The solution was to setup custom Pickle handlers to work around this issue. To make it work with 'spawn' method you need to A later version can be further streamlined by wrapping the pyx class in a python module which will install these things automatically. It should be okay for now. Thank you so much for helping debug this! |
Refactored tests to make them work
It appears the Queue only supports the "fork" starting method for
multiprocessing
. Had I used "spawn" context, I would get the following error.Example script below:
Was wondering if there is any quick fix to this? Thanks.
The text was updated successfully, but these errors were encountered: