Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(5037)

Issue 6498060: code review 6498060: cgo/misc/test: burn CPU to improve sleep accuracy (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 8 months ago by dave
Modified:
11 years, 7 months ago
Reviewers:
CC:
minux1, r, golang-dev
Visibility:
Public.

Description

cgo/misc/test: burn CPU to improve sleep accuracy Fixes issue 4008. Run a background goroutine that wastes CPU to trick the power management into raising the CPU frequency which, by side effect, makes sleep more accurate on arm. === RUN TestParallelSleep --- PASS: TestParallelSleep (1.30 seconds) _cgo_gotypes.go:772: sleep(1) slept for 1.000458s

Patch Set 1 #

Patch Set 2 : code review 6498060: cgo/misc/test: burn CPU to improve sleep accuracy #

Patch Set 3 : diff -r 8afe25accb81 https://code.google.com/p/go #

Patch Set 4 : diff -r 8afe25accb81 https://code.google.com/p/go #

Total comments: 4

Patch Set 5 : diff -r 8afe25accb81 https://code.google.com/p/go #

Total comments: 6

Patch Set 6 : diff -r 8afe25accb81 https://code.google.com/p/go #

Patch Set 7 : diff -r e6da0262840c https://go.googlecode.com/hg/ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+25 lines, -6 lines) Patch
M misc/cgo/test/issue1560.go View 1 2 3 4 5 1 chunk +25 lines, -6 lines 0 comments Download

Messages

Total messages: 13
dave_cheney.net
Hello minux.ma@gmail.com (cc: golang-dev@googlegroups.com), I'd like you to review this change to https://code.google.com/p/go
11 years, 8 months ago (2012-08-30 03:50:22 UTC) #1
minux1
i think this is a better solution than CL 6488056. the solution SGTM, but i ...
11 years, 8 months ago (2012-08-30 09:48:26 UTC) #2
dave_cheney.net
Hello minux.ma@gmail.com (cc: golang-dev@googlegroups.com), Please take another look.
11 years, 8 months ago (2012-08-30 10:55:20 UTC) #3
dave_cheney.net
Thank you for your comments. http://codereview.appspot.com/6498060/diff/7001/misc/cgo/test/issue1560.go File misc/cgo/test/issue1560.go (right): http://codereview.appspot.com/6498060/diff/7001/misc/cgo/test/issue1560.go#newcode42 misc/cgo/test/issue1560.go:42: func wasteCPU() chan struct{} ...
11 years, 8 months ago (2012-08-30 10:56:02 UTC) #4
minux1
http://codereview.appspot.com/6498060/diff/5002/misc/cgo/test/issue1560.go File misc/cgo/test/issue1560.go (right): http://codereview.appspot.com/6498060/diff/5002/misc/cgo/test/issue1560.go#newcode61 misc/cgo/test/issue1560.go:61: runtime.GOMAXPROCS(2) how about this? defer runtime.GOMAXPROCS(runtime.GOMAXPROCS(2)) runtime.GOMAXPROCS() will always ...
11 years, 8 months ago (2012-08-30 10:59:37 UTC) #5
dave_cheney.net
http://codereview.appspot.com/6498060/diff/5002/misc/cgo/test/issue1560.go File misc/cgo/test/issue1560.go (right): http://codereview.appspot.com/6498060/diff/5002/misc/cgo/test/issue1560.go#newcode61 misc/cgo/test/issue1560.go:61: runtime.GOMAXPROCS(2) On 2012/08/30 10:59:37, minux wrote: > how about ...
11 years, 8 months ago (2012-08-30 11:01:02 UTC) #6
r
wow cool. or hot. after minux's suggestion this LGTM but someone who knows arm better ...
11 years, 8 months ago (2012-08-31 00:11:34 UTC) #7
dave_cheney.net
Thank you for your comments, PTAL. http://codereview.appspot.com/6498060/diff/5002/misc/cgo/test/issue1560.go File misc/cgo/test/issue1560.go (right): http://codereview.appspot.com/6498060/diff/5002/misc/cgo/test/issue1560.go#newcode39 misc/cgo/test/issue1560.go:39: // CPU which ...
11 years, 8 months ago (2012-08-31 00:14:40 UTC) #8
dave_cheney.net
Hello minux.ma@gmail.com, r@golang.org (cc: golang-dev@googlegroups.com), Please take another look.
11 years, 8 months ago (2012-08-31 00:15:00 UTC) #9
r
LGTM but wait for minux
11 years, 8 months ago (2012-08-31 00:16:09 UTC) #10
dave_cheney.net
On 2012/08/31 00:16:09, r wrote: > LGTM but wait for minux Here is a datapoint ...
11 years, 8 months ago (2012-08-31 02:18:57 UTC) #11
minux1
LGTM. Thanks.
11 years, 8 months ago (2012-08-31 07:39:52 UTC) #12
dave_cheney.net
11 years, 8 months ago (2012-08-31 10:18:13 UTC) #13
*** Submitted as http://code.google.com/p/go/source/detail?r=18a0bd67b4b4 ***

cgo/misc/test: burn CPU to improve sleep accuracy

Fixes issue 4008.

Run a background goroutine that wastes CPU to trick the
power management into raising the CPU frequency which,
by side effect, makes sleep more accurate on arm.

=== RUN TestParallelSleep
--- PASS: TestParallelSleep (1.30 seconds)
_cgo_gotypes.go:772:    sleep(1) slept for 1.000458s

R=minux.ma, r
CC=golang-dev
http://codereview.appspot.com/6498060
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b