runtime: use lock-free ring for work queues
Use lock-free fixed-size ring for work queues
instead of an unbounded mutex-protected array.
The ring has single producer and multiple consumers.
If the ring overflows, work is put onto global queue.
benchmark old ns/op new ns/op delta
BenchmarkMatmult 7 5 -18.12%
BenchmarkMatmult-4 2 2 -18.98%
BenchmarkMatmult-16 1 0 -12.84%
BenchmarkCreateGoroutines 105 88 -16.10%
BenchmarkCreateGoroutines-4 376 219 -41.76%
BenchmarkCreateGoroutines-16 241 174 -27.80%
BenchmarkCreateGoroutinesParallel 103 87 -14.66%
BenchmarkCreateGoroutinesParallel-4 169 143 -15.38%
BenchmarkCreateGoroutinesParallel-16 158 151 -4.43%
Hello golang-codereviews@googlegroups.com (cc: ddetlefs@google.com, devon.odell@gmail.com), I'd like you to review this change to https://dvyukov%40google.com@code.google.com/p/go/
11 years, 3 months ago
(2014-01-01 09:05:54 UTC)
#1
*** Submitted as https://code.google.com/p/go/source/detail?r=209c0d648d9c *** runtime: use lock-free ring for work queues Use lock-free fixed-size ...
11 years, 2 months ago
(2014-01-16 08:17:14 UTC)
#3
*** Submitted as https://code.google.com/p/go/source/detail?r=209c0d648d9c ***
runtime: use lock-free ring for work queues
Use lock-free fixed-size ring for work queues
instead of an unbounded mutex-protected array.
The ring has single producer and multiple consumers.
If the ring overflows, work is put onto global queue.
benchmark old ns/op new ns/op delta
BenchmarkMatmult 7 5 -18.12%
BenchmarkMatmult-4 2 2 -18.98%
BenchmarkMatmult-16 1 0 -12.84%
BenchmarkCreateGoroutines 105 88 -16.10%
BenchmarkCreateGoroutines-4 376 219 -41.76%
BenchmarkCreateGoroutines-16 241 174 -27.80%
BenchmarkCreateGoroutinesParallel 103 87 -14.66%
BenchmarkCreateGoroutinesParallel-4 169 143 -15.38%
BenchmarkCreateGoroutinesParallel-16 158 151 -4.43%
R=golang-codereviews, rsc
CC=ddetlefs, devon.odell, golang-codereviews
https://codereview.appspot.com/46170044
Issue 46170044: code review 46170044: runtime: use lock-free ring for work queues
(Closed)
Created 11 years, 3 months ago by dvyukov
Modified 11 years, 2 months ago
Reviewers:
Base URL:
Comments: 0