Skip to content

Lazily instantiate the event loop of isolated execution contexts#16063

Merged
straight-shoota merged 1 commit intocrystal-lang:masterfrom
ysbaddaden:feature/execution-context-isolated-lazy-evloop
Aug 9, 2025
Merged

Lazily instantiate the event loop of isolated execution contexts#16063
straight-shoota merged 1 commit intocrystal-lang:masterfrom
ysbaddaden:feature/execution-context-isolated-lazy-evloop

Conversation

@ysbaddaden
Copy link
Collaborator

An isolated context might not need an event loop and certainly doesn't need one to be started upfront. We can delay its instantiation to when we need it.

The fiber is isolated, so it doesn't need to bother with concurrency or parallelism issues, however the context must support two mechanisms to suspend the fiber/thread: wait on the event loop (when instantiated) and wait on a condition variable otherwise.

An isolated context might not need an evloop and certainly doesn't need
one to be started upfront. It can be lazily instantiated on demand.

The fiber is isolated, so it doesn't need to bother with concurrency or
parallelism issues, however the context must support two mechanisms to
suspend the fiber/thread: wait on the event loop (when instantiated) and
wait on a condition variable otherwise.
@ysbaddaden ysbaddaden marked this pull request as ready for review August 7, 2025 10:56
@straight-shoota straight-shoota added this to the 1.18.0 milestone Aug 7, 2025
@straight-shoota straight-shoota merged commit 37b12f6 into crystal-lang:master Aug 9, 2025
49 of 51 checks passed
@github-project-automation github-project-automation bot moved this from Review to Done in Multi-threading Aug 9, 2025
@ysbaddaden ysbaddaden deleted the feature/execution-context-isolated-lazy-evloop branch August 11, 2025 13:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants