Commit Graph

4 Commits

Author SHA1 Message Date
wm4 1ad027e8fd thread_pool: add a helper function
The behavior of mp_thread_pool_queue() doesn't or shouldn't change, but
the new helper function requires touching its logic.
2018-05-24 19:56:35 +02:00
wm4 f0cc6ba18d thread_pool: move comments to .h file 2018-05-24 19:56:35 +02:00
wm4 a1ed1f8be0 thread_pool: make it slightly less dumb
The existing thread pool code is the most primitive thread pool
possible. That's fine, but one annoying thing was that it used a static
number of threads. Make it dynamic, so we don't need to "waste" idle
threads.

This tries to add threads as needed. If threads are idle for some time,
destroy them again until a minimum number of threads is reached.

Also change the license to ISC.
2018-05-24 19:56:34 +02:00
wm4 ec3dd7164c misc: add a thread pool
To be used by the following commits.
2017-04-01 20:32:01 +02:00