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

Issue 6501077: code review 6501077: runtime: refactor goroutine blocking (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years, 7 months ago by dvyukov
Modified:
12 years, 6 months ago
Reviewers:
CC:
rsc, remyoudompheng, dave_cheney.net, golang-dev
Visibility:
Public.

Description

runtime: refactor goroutine blocking The change is a preparation for the new scheduler. It introduces runtime.park() function, that will atomically unlock the mutex and park the goroutine. It will allow to remove the racy readyonstop flag that is difficult to implement w/o the global scheduler mutex.

Patch Set 1 #

Patch Set 2 : diff -r 5c4859bc123f https://dvyukov%40google.com@code.google.com/p/go/ #

Patch Set 3 : diff -r 5c4859bc123f https://dvyukov%40google.com@code.google.com/p/go/ #

Patch Set 4 : diff -r 5c4859bc123f https://dvyukov%40google.com@code.google.com/p/go/ #

Patch Set 5 : diff -r 5c4859bc123f https://dvyukov%40google.com@code.google.com/p/go/ #

Patch Set 6 : diff -r 5c4859bc123f https://dvyukov%40google.com@code.google.com/p/go/ #

Total comments: 1

Patch Set 7 : diff -r 5c4859bc123f https://dvyukov%40google.com@code.google.com/p/go/ #

Total comments: 5

Patch Set 8 : diff -r 5c4859bc123f https://dvyukov%40google.com@code.google.com/p/go/ #

Patch Set 9 : diff -r 504058dabc37 https://dvyukov%40google.com@code.google.com/p/go/ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+32 lines, -53 lines) Patch
M src/pkg/runtime/chan.c View 1 2 3 4 5 6 8 chunks +8 lines, -29 lines 0 comments Download
M src/pkg/runtime/mgc0.c View 1 2 3 4 5 6 7 8 1 chunk +1 line, -3 lines 0 comments Download
M src/pkg/runtime/proc.c View 1 2 3 4 5 6 1 chunk +12 lines, -0 lines 0 comments Download
M src/pkg/runtime/runtime.h View 1 2 3 4 5 6 7 8 1 chunk +2 lines, -1 line 0 comments Download
M src/pkg/runtime/sema.goc View 1 2 3 4 5 6 1 chunk +1 line, -4 lines 0 comments Download
M src/pkg/runtime/time.goc View 1 2 3 4 5 6 7 5 chunks +8 lines, -16 lines 0 comments Download

Messages

Total messages: 9
dvyukov
Hello rsc@golang.org (cc: golang-dev@googlegroups.com), I'd like you to review this change to https://dvyukov%40google.com@code.google.com/p/go/
12 years, 7 months ago (2012-09-03 13:48:41 UTC) #1
remyoudompheng
http://codereview.appspot.com/6501077/diff/4/src/pkg/runtime/proc.c File src/pkg/runtime/proc.c (right): http://codereview.appspot.com/6501077/diff/4/src/pkg/runtime/proc.c#newcode954 src/pkg/runtime/proc.c:954: void it could be a good idea to document ...
12 years, 7 months ago (2012-09-03 19:38:08 UTC) #2
dvyukov
On 2012/09/03 19:38:08, remyoudompheng wrote: > http://codereview.appspot.com/6501077/diff/4/src/pkg/runtime/proc.c > File src/pkg/runtime/proc.c (right): > > http://codereview.appspot.com/6501077/diff/4/src/pkg/runtime/proc.c#newcode954 > ...
12 years, 6 months ago (2012-09-04 07:40:14 UTC) #3
dave_cheney.net
http://codereview.appspot.com/6501077/diff/7003/src/pkg/runtime/time.goc File src/pkg/runtime/time.goc (right): http://codereview.appspot.com/6501077/diff/7003/src/pkg/runtime/time.goc#newcode33 src/pkg/runtime/time.goc:33: runtime·unlock(&timers); Why did you move the guard outside the ...
12 years, 6 months ago (2012-09-04 07:57:19 UTC) #4
dvyukov
http://codereview.appspot.com/6501077/diff/7003/src/pkg/runtime/time.goc File src/pkg/runtime/time.goc (right): http://codereview.appspot.com/6501077/diff/7003/src/pkg/runtime/time.goc#newcode33 src/pkg/runtime/time.goc:33: runtime·unlock(&timers); On 2012/09/04 07:57:19, dfc wrote: > Why did ...
12 years, 6 months ago (2012-09-04 08:10:06 UTC) #5
dave_cheney.net
This looks pretty good. Thank you. http://codereview.appspot.com/6501077/diff/7003/src/pkg/runtime/time.goc File src/pkg/runtime/time.goc (right): http://codereview.appspot.com/6501077/diff/7003/src/pkg/runtime/time.goc#newcode33 src/pkg/runtime/time.goc:33: runtime·unlock(&timers); On 2012/09/04 ...
12 years, 6 months ago (2012-09-04 10:36:50 UTC) #6
dvyukov
http://codereview.appspot.com/6501077/diff/7003/src/pkg/runtime/time.goc File src/pkg/runtime/time.goc (right): http://codereview.appspot.com/6501077/diff/7003/src/pkg/runtime/time.goc#newcode58 src/pkg/runtime/time.goc:58: // The caller must have set g->status and g->waitreason. ...
12 years, 6 months ago (2012-09-04 10:54:09 UTC) #7
rsc
LGTM
12 years, 6 months ago (2012-09-11 02:11:31 UTC) #8
dvyukov
12 years, 6 months ago (2012-09-18 17:15:54 UTC) #9
*** Submitted as http://code.google.com/p/go/source/detail?r=f0a385fd719f ***

runtime: refactor goroutine blocking
The change is a preparation for the new scheduler.
It introduces runtime.park() function,
that will atomically unlock the mutex and park the goroutine.
It will allow to remove the racy readyonstop flag
that is difficult to implement w/o the global scheduler mutex.

R=rsc, remyoudompheng, dave
CC=golang-dev
http://codereview.appspot.com/6501077
Sign in to reply to this message.

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