]> Cypherpunks repositories - gostls13.git/commit
sync: replace Mutex benchmarks
authorDmitriy Vyukov <dvyukov@google.com>
Tue, 28 Jun 2011 12:14:54 +0000 (08:14 -0400)
committerRuss Cox <rsc@golang.org>
Tue, 28 Jun 2011 12:14:54 +0000 (08:14 -0400)
commit5c15f8710cb570e27d1ccf04143d31c7bff52581
tree5431fb1a958437077ad81fd507b1cb2870c34557
parentcf3eeb29841d671c63d4d308bf8f5a99906d33d8
sync: replace Mutex benchmarks
For both contended and uncontended case:
 - support arbitrary number of cpus (not just 2)
 - dynamic load balancing (improves stability)
 - periodic execution of Gosched() to work around non-preemptiviness
For uncontended case eliminates possible false-sharing.
For contended case includes additional variation with some
amount of local work between mutex operations.

R=r, rsc
CC=golang-dev
https://golang.org/cl/4634093
src/pkg/sync/mutex_test.go