121 - Thread Debugging II and Split Thread Pool
Channel: StableCoder
Date: 23/08/2021

This session continues on trying to figure out why my thread pool implementation keeps hanging.

Mucking about with the condition variables, trying different strategies and ultimately trying to rebuild the thread pool to find out that most hangs seemed to have been around waiting on task completion. After switching the wait loop to a yielding loop does improve stability, from MTTF of ~50 to several hundred, but still issues do persist.

The second part is creating a new thread pool type, the SplitThreadPool. Changing it up to use a free function style of interaction, and a concept of 'synchronous' and 'asynchronous' threads. The idea being that the synchronous threads are for work that is fairly consistent and needs to be done each program loop and asynchronous work can go across several loops. But, if there is no asynchronous work to be done then the threads can help 'accelerate' synchronous work by stealing work from that task pool.

2021/08/19