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

Issue 113110043: code review 113110043: runtime: refactor routines for stopping, running gorout... (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 8 months ago by rsc
Modified:
10 years, 8 months ago
Reviewers:
gobot, iant, dvyukov
CC:
iant, golang-codereviews, rlh
Visibility:
Public.

Description

runtime: refactor routines for stopping, running goroutine from m This CL adds 'dropg', which is called to drop the association between m and its current goroutine, and it makes schedule handle locked goroutines correctly, instead of requiring all callers of schedule to do that. The effect is that if you want to take over an m for, say, garbage collection work while still allowing the current g to run on some other m, you can do an mcall to a function that is: // dissociate gp dropg(); gp->status = Gwaiting; // for ready // put gp on run queue for others to find runtime·ready(gp); /* ... do other work here ... */ // done with m, let it run goroutines again schedule(); Before this CL, the dropg() body had to be written explicitly, and the check for lockedg before schedule had to be written explicitly too, both of which make the code a bit more fragile than it needs to be.

Patch Set 1 #

Patch Set 2 : diff -r 6866fbf95095 https://code.google.com/p/go/ #

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

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

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

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

Unified diffs Side-by-side diffs Delta from patch set Stats (+31 lines, -16 lines) Patch
M src/pkg/runtime/proc.c View 1 2 3 8 chunks +31 lines, -16 lines 0 comments Download

Messages

Total messages: 5
rsc
Hello dvyukov, iant (cc: golang-codereviews@googlegroups.com, rlh@golang.org), I'd like you to review this change to https://code.google.com/p/go/
10 years, 8 months ago (2014-07-14 21:43:08 UTC) #1
iant
LGTM
10 years, 8 months ago (2014-07-15 00:13:33 UTC) #2
rsc
*** Submitted as https://code.google.com/p/go/source/detail?r=13af066c1267 *** runtime: refactor routines for stopping, running goroutine from m This ...
10 years, 8 months ago (2014-07-15 00:56:43 UTC) #3
gobot
This CL appears to have broken the nacl-amd64p32 builder. See http://build.golang.org/log/4f9252fdaa9cce529cf80cf8387d3cc0518f162b
10 years, 8 months ago (2014-07-15 01:20:11 UTC) #4
dvyukov
10 years, 8 months ago (2014-07-15 06:26:36 UTC) #5
Message was sent while issue was closed.
LGTM
Sign in to reply to this message.

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