Closed inspirit closed 9 years ago
looks like my problem is due to detached threads state... Strangely enough i loose connection to detached threads when the app is terminating. seem like windows terminate them before my thread-pool class destructor got executed
Sounds like an issue that is specific to your project... Best of luck, man!
Hi,
this might be my app architecture flow but still i would like to check.
i have multiple threads. each has its own AutoResetEvent object.
threads are running while there is a job in some shared queue. if no job can be found. each goes to sleep: my_event.wait();
when i'm adding job i iterate through all threads: thread.event.signal(); so i dont check if thread is actually wait, i always call signal for all threads.
everything works just fine until the whole threading pool is destructed:
the app hangs on last step because some threads did not exit, and so do not reduce thread count atomic variable. i wasnt able to reproduce it on Mac but it happens often on Windows machine...