Skip to content

Latest commit

 

History

History
16 lines (12 loc) · 788 Bytes

README.md

File metadata and controls

16 lines (12 loc) · 788 Bytes

Thread pool

Classic implementation of thread pool and wait-free variant.

Preamble

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.

Synchronized

Classic implementation of thread pool. It's optimal, does not make busy-loops, robust and debug friendly.

Wait-free

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

Conslusion

Test shows no significant performance boost of wait-free over synchronized thread pool.