Improve docs for Fiber::ExecutionContext#16602
Improve docs for Fiber::ExecutionContext#16602ysbaddaden wants to merge 3 commits intocrystal-lang:masterfrom
Fiber::ExecutionContext#16602Conversation
Co-authored-by: Johannes Müller <straightshoota@gmail.com>
bcardiff
left a comment
There was a problem hiding this comment.
I think we can also add, if not present, something about how EC are allocated in system threads and how these are setup.
A couple of questions that arise:
I assume that Isolated is pinned to a system thread, but I am not sure if that holds for concurrent.
In parallel, do have a way to configure the affinity?
Do execution context share system threads? I assume they don't.
|
The wording has been chosen to focus on the guarantees of how the fibers will run (that won't change), not how they are related to system threads (implementation detail, will change). In #15885 we start to decouple schedulers and threads — similar to how Go decouples P from M, where a Processor (scheduler) can run on any Machine (system thread). It allows to reuse system threads across execution contexts. Starting with #15871 The one exception is the In any case, a thread will be reused to reattach a scheduler (isolated, concurrent or parallel). The documentation of each type should be explicit about its guarantees (the general intro on |
|
I understand focusing on guarantees and not on implementation details. But some language features like ThreadLocal require a deeper understanding due to abstraction leak. |
|
Let's keep it as DRAFT. We can keep improving 💪 |
An attempt to improve the API docs for execution contexts a bit. Improve readability, link to
Syncand fix a few potentially confusing phrases.