-
-
Notifications
You must be signed in to change notification settings - Fork 0
feat: Thread support #118
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
feat: Thread support #118
Conversation
… against reentrancy problems in event_hook_raw
… the execution of event_hook_raw() in the same thread
…ng the logging of a thread.join line
…s, because their parameter is variable (contains a thread id, which is different on every program run)
| return; | ||
| } | ||
|
|
||
| let thread_id: u64 = rb_eval_string(c"Thread.current".as_ptr() as *const c_char) |
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.
discussed in discord chat: writing again one question here, sorry for repeating: isn't this slow: to evaluate it as ruby code : it seems we can access the thread_id in other places from *const rb_internal_thread_event_data_t, probably here we can't access something like that?
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 thread ID is not directly available in the structure, passed by address to this callback function. It is possible to reach it, but you need to follow pointers to internal Ruby interpreter structures, and I'm not sure if these are stable, since they're not part of the public API, and will probably change often with Ruby versions.
Benchmark Report
|
No description provided.