Print scheduler details (ExecutionContext)#18
Merged
ysbaddaden merged 7 commits intomainfrom May 19, 2025
Merged
Conversation
ysbaddaden
commented
Jun 28, 2024
straight-shoota
pushed a commit
to crystal-lang/crystal
that referenced
this pull request
Aug 7, 2024
Add `GC.stop_world` and `GC.start_world` methods to be able to stop and restart the world at will from within Crystal. - gc/boehm: delegates to `GC_stop_world_external` and `GC_start_world_external`; - gc/none: implements its own mechanism (tested on UNIX & Windows). My use case is a [perf-tools](https://github.com/crystal-lang/perf-tools) feature for [RFC 2](crystal-lang/rfcs#2) that must stop the world to print out runtime information of each ExecutionContext with their schedulers and fibers. See crystal-lang/perf-tools#18
ysbaddaden
commented
May 5, 2025
Contributor
Author
|
Tested against Crystal 1.16.2 and polished with a few last details. Ready for review. |
straight-shoota
approved these changes
May 16, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Prints runtime information about a program, either at regular interval, programmatically or on demand (through a signal), with or without the list of fibers (that can be huge). Stops the world to be able to print an accurate map of all execution contexts,
For example (idle program with a couple additional execution contexts):
Requirements:
Crystal with Thread.stop_world (merged in 1.14.0)Crystal with Fiber::ExecutionContext (merged in 1.16.0)Usage:
Specify
details: trueto also print the list of fibers in each execution context.