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

blosc2 freezes when used in a ProcessPoolExecutor -- fine in a ThreadPoolExecutor #237

Open
tazr opened this issue Aug 16, 2024 · 0 comments

Comments

@tazr
Copy link

tazr commented Aug 16, 2024

from concurrent.futures import ProcessPoolExecutor, ThreadPoolExecutor

import blosc2
import numpy as np


def test(arr):
    print("test begins")
    blosc2.pack_array(arr)
    print("test ends")


def main():
    arrs = [np.random.randint(255, size=(1024, 1024), dtype=np.uint8) for _ in range(20)]

    with ThreadPoolExecutor(max_workers=2) as pool:
        for arr in arrs:
            pool.submit(test, arr=arr)

    print("threadpool done")
    with ProcessPoolExecutor(max_workers=2) as pool:
        for arr in arrs:
            pool.submit(test, arr=arr)
    print("processpool done")  # never printed


if __name__ == "__main__":
    main()

I tried to set blosc2.ncores/nthreads to 1 but to no avail.

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

1 participant