How to keep track of number of running threads?
Closed this issue · 2 comments
RSH2000 commented
In may be a request for enhancement rather than an issue, but , is there a way to keep track of number of active threads at each time?
X= thpool->num_threads_working; gives me the following error:
Myprog.c:872:40: error: dereferencing pointer to incomplete type ‘struct thpool_’
X=thpool->num_threads_working;
Thanks,
Pithikos commented
I had a look at this and with commit @48ae25d35a83febdff1b921acc5e41c71a60fda7 you should be able and do that now. However you need to follow the API.
In your case:
X=thpool_num_threads_working(thpool);
RSH2000 commented
Thanks for the quick enhancement! That worked great.