Add a new task pool class to LLDB to make it easy to execute tasks in parallel
Basic design goals:
- Have a very lightweight and easy to use interface where a list of lambdas can be executed in parallel
- Use a global thread pool to limit the number of threads used (std::async don't do it on Linux) and to eliminate the thread creation overhead
Possible future improvements (please weight in about priorities about these and add what additional features you want to see):
- Possibility to cancel already added, but not yet started tasks
- Lazy creation of the worker threads
- Removing unused worker threads after some time
- Parallel for_each implementation
The first user of the thread pool will be the dwarf parsing code. An example of how it will be used is available at http://reviews.llvm.org/D13662 (diff 2)
belonging to