Thread pool template and example. Should be both Linux and Windows compatible.