1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-02-01 05:01:59 +01:00
Fangrui Song 2e7ead2539 Parallel: only allow the first TaskGroup to run tasks parallelly
Summary:
Concurrent (e.g. nested) llvm::parallel::for_each() may lead to dead
locks. See PR35788 (fixed by rLLD322041) and PR41508 (fixed by D60757).

When parallel_for_each() is about to return, in ~Latch() called by
~TaskGroup(), a thread (in the default executor) may block in
Latch::sync() waiting for Count to become zero. If all threads in the
default executor are blocked, it is a dead lock.

To fix this, force serial execution if the current TaskGroup is not the
first one. For a nested llvm::parallel::for_each(), this parallelizes
the outermost loop and serializes inner loops.

Differential Revision: https://reviews.llvm.org/D61115

llvm-svn: 359182
2019-04-25 11:33:30 +00:00
..
2019-04-24 23:24:53 +00:00
2019-04-19 02:06:06 +00:00
2019-04-08 12:31:12 +00:00
2019-04-08 12:31:12 +00:00
2018-04-02 13:49:35 +00:00
2018-07-30 19:41:25 +00:00
2019-04-23 14:51:27 +00:00