]> git.itanic.dy.fi Git - rrdd/commit
process: Handle threads dynamically
authorTimo Kokkonen <timo.t.kokkonen@iki.fi>
Sat, 9 Jul 2016 17:18:13 +0000 (20:18 +0300)
committerTimo Kokkonen <timo.t.kokkonen@iki.fi>
Sat, 9 Jul 2016 17:50:42 +0000 (20:50 +0300)
commit47aa018a078a99e5ce64ddbf0de5ca6c19be82a9
treeccdfd2ad054ceb64ee9281cf48b7d16f7d42ce5c
parentb258d4904d5e89dd6b05100c4e0e0c52424be22e
process: Handle threads dynamically

Instead of hard coding thread number on start up, handle them
dynamically as needed.

The max_jobs variable determines how many workers there may be
running. However, there are also high priority works that should be
executed even though thread count is already maxed. Thus we start a
new worker whenever a high priority work is queued.

As soon as work is finished and there are no more work to do or there
are too many threads to do low priority work, threads will exit.

Signed-off-by: Timo Kokkonen <timo.t.kokkonen@iki.fi>
process.c