[Lldb-commits] [PATCH] D13727: Add task pool to LLDB

Pavel Labath via lldb-commits lldb-commits at lists.llvm.org
Fri Oct 16 03:31:15 PDT 2015

labath added a comment.

In http://reviews.llvm.org/D13727#268747, @tberghammer wrote:

> Based on Pavel's example and some additional experimenting we done I am not sure if std::async will give us any benefit even on Windows as it don't limit the number of threads to the number of cores (because it can't do if it want to implement the standard). I have no problem with having 2 implementation (considering that one of them is very simple) but if it don't give us any benefit, then I would prefer to ignore it.

To back these with some numbers, let me explain what I have done: I have modified the f() function in my example to do some actual work (count to a very large number). On my Windows VM with hardware_concurrency()==16, after one second, I had about 70 threads running (more than 4 times the number of cpus). Since our tasks are going to be cpu-intensive, there is no point in having more than 16 of them running, and using std::async will cause a lot of contention, which will slow everything down. I believe the async implementation is not suited for our purpose here and we should not use it.


More information about the lldb-commits mailing list