Skip to content
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

Thread: set name #14257

Merged
Merged

Conversation

ysbaddaden
Copy link
Contributor

@ysbaddaden ysbaddaden commented Jan 26, 2024

This allows to identify the thread by name, including in system applications, such as top -H or gdb sessions. For example with MT:4 we can see the main crystal thread (not renamed), the 7 GC threads, and the 3 MT threads.

Capture d’écran de 2024-01-26 18-25-08@2x

EDIT: the scheduler threads are now named CRYSTAL-MT-i not mt-i (unlike the screenshot).

This allows to identify the thread by name, including in system
applications, such as `top -H` or `gdb` sessions.
src/crystal/scheduler.cr Outdated Show resolved Hide resolved
src/crystal/system/thread.cr Outdated Show resolved Hide resolved
Co-authored-by: Johannes Müller <straightshoota@gmail.com>
@straight-shoota straight-shoota added this to the 1.12.0 milestone Jan 29, 2024
@straight-shoota straight-shoota merged commit 8d1c080 into crystal-lang:master Jan 30, 2024
57 checks passed
@ysbaddaden ysbaddaden deleted the feature/naming-threads branch February 1, 2024 17:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

6 participants