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

How can I use a multiprocessing.manager alongside with pebble to avoid re-importing the function everytime? #120

Closed
pedro-peixot0 opened this issue Sep 18, 2023 · 1 comment
Labels

Comments

@pedro-peixot0
Copy link

My threads were taking too long to run and I noticed it was due to the file I am importing the function to run having a lot of imports and those being fetched by every new thread.

I saw that with multiprocessing you could use a manager to register functions and avoid this re-importing (https://stackoverflow.com/questions/48680134/how-to-avoid-double-imports-with-the-python-multiprocessing-module)
How can I do something like this still using pebble?

@noxdafox
Copy link
Owner

noxdafox commented Sep 20, 2023

Hello,

please do not use GitHub to ask for questions. GH issues are to report bugs or unexpected behaviour and not to ask for guidance. For such, there is StackOverflow (in particular, the multiprocessing tag).

Pebble relies on the Python multiprocessing module. Hence, most of approaches which work for multiprocessing work for Pebble as well.

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

No branches or pull requests

2 participants