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

importing blaze starts `cpu_count() + 3` threads #1331

Closed
richafrank opened this issue Dec 1, 2015 · 1 comment

Comments

@richafrank
Copy link
Contributor

commented Dec 1, 2015

Not exactly a bug, but maybe an improvement request -

In debugging some context switching in our app, I was surprised to see a number of extra python Threads running. It turned out they are started by the import of blaze, because blaze/__init__.py imports blaze/utils.py, which instantiates a multiprocessing.ThreadPool at module scope. The pool starts 3 helper threads plus 1 thread per cpu.

I think this pool is only used by h5py. Is its creation something that could be made lazy, such that apps don't need to run the extra threads just to import blaze, especially if they don't compute with h5py?

@richafrank

This comment has been minimized.

Copy link
Contributor Author

commented Dec 9, 2015

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.