Nick Porcino
Nick Porcino
exit() is defined to terminate an entire process, including child threads, and transfer control to the host environment. Exit does a certain amount of cleanup that is largely implementation specific....
Can you try this? Right now there's this code in IlmThreadPool.cpp: ```cpp size_t curT = _data.threads.size(); for (size_t i = 0; i != curT; ++i) { _data.taskSemaphore.post(); _data.threadSemaphore.wait(); } //...
@lgritz Are you able to check if my patch helps?
@lgritz, I haven't pushed the proposed patch to my fork... I'd like to see this sorted out as well, so I can try it in the next couple of days...
Ah, thanks very much, I appreciate it :)
@debaetsd The proposed patch looks robust. I can't shake a feeling though, that there's a fundamental problem with the design of ThreadPool itself. I haven't had time to look at...
My proposed fix does solve the problem of signaling more threads than exist, and attempting to join threads which are not joinable, both of which are potential deadlocking errors. Whether...
does or does not fix?
are the deadlocks shutdown related, or elsewhere? This patch is only shutdown related.
Your proposed change adds an explicit contract that after calling setGlobalThreadCount, the global thread count will reflect the request. I like the idea and your sketch looks reasonable. Does it...