libosmscout icon indicating copy to clipboard operation
libosmscout copied to clipboard

Implement ThreadedWorkerPool

Open Framstag opened this issue 4 years ago • 0 comments

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

Framstag avatar Mar 30 '21 13:03 Framstag