Classic implementation of thread pool and wait-free variant.
There are reasons why to prefer thread pool realisation based on condition_variable and mutex.
But let's try to implement lock/wait-free and compare.
Classic implementation of thread pool. It's optimal, does not make busy-loops, robust and debug friendly.
Is baised on simplified FIFO queue(linked list) with CAS push_back/pop_front methods. This thread pool dynamicaly creates threads under load (does not precreate threads nor keeps sleeping workers) but it's requere managing thread
Test shows no significant performance boost of wait-free over synchronized thread pool.