OpenMp Thread Pool

OpenMp Thread Pool

Hi everyone. 
I am trying to understand the OpenMp thread pool, and I have two questions related to that:

1) which function is responsible for putting worker threads into the pool after finishing their work?

2) If we have two pthreads or more and each of them creates a parallel region using #pragma omp, are they going to have the same thread pool OR each pthread will have its own thread pool?

Thanks in advance,

Ali

3 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Hi Ali,

1. The function __kmp_free_thread() puts threads into pool.

2. A bit of terminology, - what you are calling pool here is usually called team of threads.  Thread pool is global set of threads those do not have work at the moment. When master thread encounters parallel region it creates team of threads, we do not call this team a pool. As to different pthreads, by default they do not share worker threads, each pthread has its own dedicated team of threads.

Regards,
Andrey

Thanks a lot.

Leave a Comment

Please sign in to add a comment. Not a member? Join today