Skip to content
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

Process.fork is not supported by this Ruby #318

Closed
enumag opened this issue Mar 15, 2022 · 7 comments
Closed

Process.fork is not supported by this Ruby #318

enumag opened this issue Mar 15, 2022 · 7 comments

Comments

@enumag
Copy link
Contributor

enumag commented Mar 15, 2022

Hello. I wanted to use the parallel gem but I'm getting this error. What's going on and how can I fix it please?

@grosser
Copy link
Owner

grosser commented Mar 15, 2022

need to use threads if fork is not supported
you can use threads to spam processes

Parallel.in_threads(4) do
  `echo hey`
end

@grosser grosser closed this as completed Mar 15, 2022
@enumag
Copy link
Contributor Author

enumag commented Mar 15, 2022

Unfortunately I don't think threads will work in my case. I need to do some work in separate process.

@grosser
Copy link
Owner

grosser commented Mar 15, 2022

then chose a different ruby or make your threads fork as I showed
... can also try ractors, see #317 but that's pretty risky/new

@enumag
Copy link
Contributor Author

enumag commented Mar 15, 2022

Does these ractors work on Windows?

@grosser
Copy link
Owner

grosser commented Mar 15, 2022

yeah on ruby 3.0+
... doubt it works on jruby, so not really an option for you afaik

@enumag
Copy link
Contributor Author

enumag commented Mar 15, 2022

Sorry but I'm a newbie. I don’t even know what jruby is. If I'm somehow using it then I'm not aware of it.

EDIT ah some sort of Java implementation of Ruby... no definitely didn't install that... I'm just using regular Ruby 3.1 for Windows

@grosser
Copy link
Owner

grosser commented Mar 15, 2022

ah yeah, fork does not work on windows

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants