-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Rename execution contexts + improve their docs #15936
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
base: master
Are you sure you want to change the base?
Rename execution contexts + improve their docs #15936
Conversation
# Concurrency is restricted to a single thread. Fibers in the same context | ||
# will never run in parallel to each other but they may still run in parallel | ||
# to fibers running in other contexts (i.e. in another thread). | ||
# Fibers running in this context can only run concurrently and never in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion: Keep the wording of "the same context. This point out clearly that this refers to specific context instances. Fibers in different instances of Concurrent
do run parallel to each other.
# Fibers running in this context can only run concurrently and never in | |
# Fibers running in the same context can only run concurrently and never in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Weirdly, using "same context" is more confusing to me (it seems to apply to all contexts outside of concurrent).
Maybe "this context instance" or "same context instance" maybe?
Hum, it's not that confusing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"the same context instance" would be a bit more precise. But it's also quite a mouthful.
Co-authored-by: Johannes Müller <[email protected]>
Co-authored-by: sbsoftware <[email protected]>
As discussed in RFC 2 and in light of #15871 for example, the execution contexts are much more about "how fibers run", either concurrently or in parallel or by themselves (the intent), and have little to do with "threads" that are only the technical mean to achieve parallelism.
A great example is that the isolated context doesn't have the word thread in its name, despite being the only context that guarantees the fiber will always run on the same thread (the fiber owns the thread until it terminates).
This PR renames:
SingleThreaded
toConcurrent
MultiThreaded
toParallel
It also refines the documentation of the different types to also insist on the intent, what it means, and what are the actual guarantees given by each context.