[PATCH] D123225: [ThreadPool] add ability to group tasks into separate groups

Alexandre Ganea via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 26 05:49:42 PDT 2022


aganea added inline comments.


================
Comment at: llvm/lib/Support/ThreadPool.cpp:155
+  // possible deadlock.
+  processTasks(&Group);
 }
----------------
One more thing perhaps: tasks `.wait()`-ing will be "suspended" by re-entering `processTasks`. Any remaining tasks in the queue will be scheduled randomly over the waiting task(s), and this could easily create stack-overflows, since the scheduling is non-deterministic (so we could have several tasks waiting, piled on the top of each other). Depending on the stack size per platform, and how much stack each task eats up, this could potentially cause random crashes in production.

Probably the less intrusive approach would be to use fibers for suspended tasks. I suppose we could do that as a secondary step after this patch.


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

https://reviews.llvm.org/D123225



More information about the llvm-commits mailing list