summaryrefslogtreecommitdiff
path: root/AUTHORS
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2014-07-14 20:56:37 -0400
committerRuss Cox <rsc@golang.org>2014-07-14 20:56:37 -0400
commit9c691370f785ec97c03c8169db88b3d5a674fb3c (patch)
treecb4fb2dfed737587cb4632f4dff9ce2766b72d2b /AUTHORS
parent97d0820437c00773f24748d8221974add217a848 (diff)
downloadgo-9c691370f785ec97c03c8169db88b3d5a674fb3c.tar.gz
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. LGTM=iant R=dvyukov, iant CC=golang-codereviews, rlh https://codereview.appspot.com/113110043
Diffstat (limited to 'AUTHORS')
0 files changed, 0 insertions, 0 deletions