threadpoolctl icon indicating copy to clipboard operation
threadpoolctl copied to clipboard

Calling threadpool_info in cython parallel block may cause a deadlock

Open jeremiedbb opened this issue 5 years ago • 0 comments

When there are multiple OpenMP loaded. Replacing 0 by any other thread_num (below) can cause the issue.

with nogil, parallel():
    if openmp.omp_get_thread_num() == 0:
        with gil:
            threadpool_info()

I'm not sure if it's a real issue. It means that trying to control the number of inner threads independently in each outer threads is a bad idea. But I think it's not the purpose of threadpoolctl.

jeremiedbb avatar Aug 02 '19 16:08 jeremiedbb