Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

runtime: preemptive scheduling #543

Closed
rsc opened this issue Jan 19, 2010 · 17 comments
Closed

runtime: preemptive scheduling #543

rsc opened this issue Jan 19, 2010 · 17 comments

Comments

@rsc
Copy link
Contributor

rsc commented Jan 19, 2010

What steps will reproduce the problem?
1. go func() { for { } }

What is the expected output? What do you see instead?
Shouldn't wedge the rest of the program but does.
@rsc
Copy link
Contributor Author

rsc commented Jan 19, 2010

@rsc
Copy link
Contributor Author

rsc commented Jan 19, 2010

Comment 2:

Step 1 should read go func() { for { } }()

@rsc
Copy link
Contributor Author

rsc commented Dec 9, 2011

Comment 3:

Labels changed: added priority-later.

@rsc
Copy link
Contributor Author

rsc commented Sep 12, 2012

Comment 5:

Labels changed: added go1.1maybe.

@rsc
Copy link
Contributor Author

rsc commented Dec 10, 2012

Comment 6:

Labels changed: added size-xl.

@robpike
Copy link
Contributor

robpike commented Mar 7, 2013

Comment 7:

Labels changed: removed go1.1maybe.

@dvyukov
Copy link
Member

dvyukov commented Apr 22, 2013

Comment 8:

Issue #4711 has been merged into this issue.

@dvyukov
Copy link
Member

dvyukov commented Apr 22, 2013

Comment 9:

Issue #5324 has been merged into this issue.

@dvyukov
Copy link
Member

dvyukov commented Apr 22, 2013

Comment 10:

There is a partial solution we can do for Go1.2 with few casualties.
Namely, make gcwaiting variable per-M. Sysmon() thread detects when an M runs the same
goroutine for a long time and sets m->gcwaiting. When a thread notices m->gcwaiting, it
calls into scheduler. If global gcwaiting is not set, it just causes rescheduling. This
way worker threads be preempted on chan/map/malloc operations.

Owner changed to @dvyukov.

@dvyukov
Copy link
Member

dvyukov commented Apr 25, 2013

Comment 11:

Issue #5324 has been merged into this issue.

@dvyukov
Copy link
Member

dvyukov commented Jun 29, 2013

Comment 12:

The following change partially addresses the issue:
https://golang.org/cl/10264044
runtime: preempt goroutines for GC
The last patch for preemptive scheduler,
with this change stoptheworld issues preemption
requests every 100us.
Update issue #543.

@rsc
Copy link
Contributor Author

rsc commented Jul 17, 2013

Comment 13:

This issue was updated by revision b913cf8.

I believe the runtime is strong enough now to reenable
preemption during the function prologue.
Assuming this is or can be made stable, it will be in Go 1.2.
More aggressive preemption is not planned for Go 1.2.
R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/11433045

@rsc
Copy link
Contributor Author

rsc commented Nov 27, 2013

Comment 14:

Labels changed: added go1.3maybe.

@rsc
Copy link
Contributor Author

rsc commented Dec 4, 2013

Comment 15:

Labels changed: added release-none, removed go1.3maybe.

@rsc
Copy link
Contributor Author

rsc commented Dec 4, 2013

Comment 16:

Labels changed: added repo-main.

@AlekSi
Copy link
Contributor

AlekSi commented Mar 5, 2017

I think discussion moved to #10958.

@ianlancetaylor
Copy link
Contributor

Thanks. I agree that everything remaining here is captured by #10958, so closing this one.

@golang golang locked and limited conversation to collaborators Mar 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants