Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cmd/compile: limit goroutine count to parallelism
When the compiler crashes, it is not uncommon to see many hundreds of goroutines all blocked waiting their turn to be one of the nWorkers goroutines that is allowed to run. All these goroutine stacks are not a terribly efficient use of memory, and they also make the crash dumps hard to read. Introduce a manager goroutine to hand out work to at most nWorker goroutines, maintaining pending work in a local slice, rather than having all those blocked goroutines hanging around waiting to run. Change-Id: I46cb4e1afd6392805f359e14554ebc17d538bcba Reviewed-on: https://go-review.googlesource.com/c/go/+/431956 Reviewed-by: Cuong Manh Le <[email protected]> Reviewed-by: Cherry Mui <[email protected]> Run-TryBot: Russ Cox <[email protected]> Auto-Submit: Russ Cox <[email protected]> TryBot-Result: Gopher Robot <[email protected]>
- Loading branch information