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
Asyncio support #837
Comments
So there are two separate issues with adding asyncio support:
This basically means that h5py is unlikely to ever support asyncio. If you've got a specific use-case you may want to explain it on the h5py mailing list (or even the hdf5 mailing lists), to see if other people have run into similar problems and have suggestions. |
Thanks for the answer. After reading the links you provided, what I get is:
|
You could try running things in a thread, no guarantees it will work well though, as I mentioned, HDF5 controls the I/O, and you will want to make sure you don't run into any of its locking controls. You probably will want to understand which file mode mentioned at http://docs.h5py.org/en/latest/high/file.html#file-drivers will work best for you. I've got no other useful advice (other than ask on the mailing lists), as using h5py/HDF5 asynchronously isn't something I've specifically something I've dug into, but I'd suggest thinking about if your current approach is the best way, e.g. if you're using HDF5 just for message passing, there are quite a few other alternatives (e.g. https://en.wikipedia.org/wiki/MessagePack) which are simpler than HDF5, or if you're using asyncio just because it's asyncio, maybe you could consider other alternatives such as multiprocessing or concurrent.futures? |
Concurrent.futures are threads, that is what I was thinking on using until asyncio support (that now I know will probably not happen). The issue is that even using a pool of threads, you incur in some overhead over polling a file descriptor. |
It looks like there are some new progress being made in the community, https://github.com/hpc-io/vol-async |
Is there any chance that h5py will add asyncio support?
I have searched here and in the mailing list and there is not even mention of asyncio support. Given that now python has an official async library, asyncio, it would make sense for h5py to support it, given the I/O nature of h5py.
The text was updated successfully, but these errors were encountered: