-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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: refactor into separate subpackages #11647
Comments
Why, exactly? |
Now that the runtime is written in Go, it's worth taking the time to consider whether it could be better organized if it were split into packages. I think it could. Splitting the runtime into packages could also help improve the readability, in the style sense, of the code. That would make the runtime more accessible to new contributors. It was also suggested by crawshaw that putting certain parts of the runtime into their own packages would make it easier to stub out or replace parts of the runtime. That would be helpful when bootstrapping a new architecture or os, where all of the runtime is not available, or in creating a modified runtime that would run without an os. |
I'm in favor of splitting up the runtime, at least insofar as it is mostly just movement of existing code. This has the following advantages:
|
CL https://golang.org/cl/14204 updates this issue. |
CL https://golang.org/cl/16817 mentions this issue. |
runtime/internal/sys will hold system-, architecture- and config- specific constants. Updates #11647 Change-Id: I6db29c312556087a42e8d2bdd9af40d157c56b54 Reviewed-on: https://go-review.googlesource.com/16817 Reviewed-by: Russ Cox <rsc@golang.org>
CL https://golang.org/cl/16870 mentions this issue. |
Somehow these were left out of the orignial CL. Updates #11647 Change-Id: I058a30eaa25fbb72d60e7fb6bc9ff0a3b54fdb2a Reviewed-on: https://go-review.googlesource.com/16870 Reviewed-by: Minux Ma <minux@golang.org>
CL https://golang.org/cl/16871 mentions this issue. |
As per mdempsky's comment on golang.org/cl/14204, textflag.h is copied to the includes dir by cmd/dist, and the copy in runtime/internal/atomic is not actually being used. Updates #11647 Change-Id: Ie95c08903a9df54cea4c70ee9d5291176f7b5609 Reviewed-on: https://go-review.googlesource.com/16871 Run-TryBot: Michael Matloob <matloob@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
We got a couple subpackages in for Go 1.6. More work in Go 1.7. |
Another advantage to this: More of the runtime could be build concurrently. It's not super slow to build, but it always runs first, and linearly, since everything else depends on it. See the graph at #15734. |
Bumping this to Go 1.9. Not sure anything happened in Go 1.8 but it seems too late now. |
CL https://golang.org/cl/41650 mentions this issue. |
Change https://golang.org/cl/171702 mentions this issue: |
The runtime package contains multitudes. I only care about a few of them. The signal to noise ratio on changes is currently too low. I hope that we will someday resume work on golang/go#11647, and/or implement some devapp filters. (Keyword-based? File-based?) Until then, I'm tapping out. Change-Id: Ib3baabb44f3a9ee48d78dcb8234c3752e0e42278 Reviewed-on: https://go-review.googlesource.com/c/build/+/171702 Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
At the very least, if there are parts of |
Another advantage to doing this: Any parts of the runtime not involved in scheduling can have their race/msan instrumentation done by the compiler rather than manually. |
Now that the runtime is Go code, we should be able to break it apart into multiple packages.
Among other things we should consider putting locking, the gc, and special symbols in separate packages.
The text was updated successfully, but these errors were encountered: