libosmscout
libosmscout copied to clipboard
Implement ThreadedWorkerPool
The header Worker.h defines a ThreadedWorker and some derived classes. Sometimes will want t process a queue by multiple instances of a ThreadedWorker (a pool).
In this case we would like to have a template of a specific Worker class, with the following features:
- allows to construct a number of worker instances with the constructor arguments passed to the pool template
- start the worker
- expose a Wait() methods, that allows to wait for all worker to be finished
- Frees all workers
See GenMergeAreas.cpp, MergeAreas for a manually crafted example