[PATCH] D70447: [Support] ThreadPoolExecutor fixes for Windows/MinGW

Mehdi AMINI via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 19 21:08:56 PST 2019


mehdi_amini added a comment.

In D70447#1790286 <https://reviews.llvm.org/D70447#1790286>, @rnk wrote:

> I guess I like the quick_exit idea. Supporting multiple shutdowns of a thread pool seems fraught with complexity.


Why exactly? Isn't it just about joining threads and deleting them? I feel I am missing something.

> I also think it's kind of reasonable to keep the Parallel.h APIs simple. You don't actually want to have more than one threadpool per process running at the same time, so if we were to change all the APIs to pass a context parameter, I'm not sure that'd be a good thing.

I'm not sure I totally agree with this: a global thread pool without preemption and priority inversion seems to be easily leading to deadlock through starvation. It is also breaking composability of library components since you may end-up enqueuing to the same pool from a thread in the pool.
Explicitly controlling the context may be suboptimal in some cases, but at least it allows to keep things scoped inside a component.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D70447/new/

https://reviews.llvm.org/D70447





More information about the llvm-commits mailing list