1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/ext/-test-
Jean Boussier 9125374726 [Feature #18339] GVL Instrumentation API
Ref: https://bugs.ruby-lang.org/issues/18339

Design:

- This tries to minimize the overhead when no hook is registered.
  It should only incur an extra unsynchronized boolean check.
- The hook list is protected with a read-write lock as to cause
  contention when some hooks are registered.
- The hooks MUST be thread safe, and MUST NOT call into Ruby as they
  are executed outside the GVL.
- It's simply a noop on Windows.

API:

```
rb_internal_thread_event_hook_t * rb_internal_thread_add_event_hook(rb_internal_thread_event_callback callback, rb_event_flag_t internal_event, void *user_data);
bool rb_internal_thread_remove_event_hook(rb_internal_thread_event_hook_t * hook);
```

You can subscribe to 3 events:

  - READY: called right before attempting to acquire the GVL
  - RESUMED: called right after successfully acquiring the GVL
  - SUSPENDED: called right after releasing the GVL.

The hooks MUST be threadsafe, as they are executed outside of the GVL, they also MUST NOT call any Ruby API.
2022-06-03 15:13:33 +02:00
..
abi [Feature #18249] Implement ABI checking 2022-02-22 09:55:21 -05:00
arith_seq/extract [Feature #18249] Update dependencies 2022-02-22 09:55:21 -05:00
array [Feature #18249] Update dependencies 2022-02-22 09:55:21 -05:00
bignum [Feature #18249] Update dependencies 2022-02-22 09:55:21 -05:00
bug-3571 [Feature #18249] Update dependencies 2022-02-22 09:55:21 -05:00
bug-5832 [Feature #18249] Update dependencies 2022-02-22 09:55:21 -05:00
bug-14834 [Feature #18249] Update dependencies 2022-02-22 09:55:21 -05:00
bug_reporter [Feature #18249] Update dependencies 2022-02-22 09:55:21 -05:00
class [Feature #18249] Update dependencies 2022-02-22 09:55:21 -05:00
cxxanyargs Update dependencies 2021-11-21 16:21:18 +09:00
debug [Feature #18249] Update dependencies 2022-02-22 09:55:21 -05:00
dln/empty Update ext/-test-/dln/empty/depend 2022-02-22 16:49:20 -05:00
enumerator_kw [Feature #18249] Update dependencies 2022-02-22 09:55:21 -05:00
exception [Feature #18249] Update dependencies 2022-02-22 09:55:21 -05:00
fatal [Feature #18249] Update dependencies 2022-02-22 09:55:21 -05:00
file [Feature #18249] Update dependencies 2022-02-22 09:55:21 -05:00
float [Feature #18249] Update dependencies 2022-02-22 09:55:21 -05:00
funcall [Feature #18249] Update dependencies 2022-02-22 09:55:21 -05:00
gvl/call_without_gvl [Feature #18249] Update dependencies 2022-02-22 09:55:21 -05:00
hash [Feature #18249] Update dependencies 2022-02-22 09:55:21 -05:00
integer [Feature #18249] Update dependencies 2022-02-22 09:55:21 -05:00
iseq_load [Feature #18249] Update dependencies 2022-02-22 09:55:21 -05:00
iter [Feature #18249] Update dependencies 2022-02-22 09:55:21 -05:00
load [Feature #18249] Update dependencies 2022-02-22 09:55:21 -05:00
marshal [Feature #18249] Update dependencies 2022-02-22 09:55:21 -05:00
memory_status [Feature #18249] Update dependencies 2022-02-22 09:55:21 -05:00
memory_view [Feature #18249] Update dependencies 2022-02-22 09:55:21 -05:00
method [Feature #18249] Update dependencies 2022-02-22 09:55:21 -05:00
notimplement [Feature #18249] Update dependencies 2022-02-22 09:55:21 -05:00
num2int [Feature #18249] Update dependencies 2022-02-22 09:55:21 -05:00
path_to_class [Feature #18249] Update dependencies 2022-02-22 09:55:21 -05:00
popen_deadlock [Feature #18249] Update dependencies 2022-02-22 09:55:21 -05:00
postponed_job [Feature #18249] Update dependencies 2022-02-22 09:55:21 -05:00
printf [Feature #18249] Update dependencies 2022-02-22 09:55:21 -05:00
proc [Feature #18249] Update dependencies 2022-02-22 09:55:21 -05:00
random [Feature #18249] Update dependencies 2022-02-22 09:55:21 -05:00
rational [Feature #18249] Update dependencies 2022-02-22 09:55:21 -05:00
rb_call_super_kw [Feature #18249] Update dependencies 2022-02-22 09:55:21 -05:00
recursion [Feature #18249] Update dependencies 2022-02-22 09:55:21 -05:00
regexp [Feature #18249] Update dependencies 2022-02-22 09:55:21 -05:00
RUBY_ALIGNOF [Feature #18249] Update dependencies 2022-02-22 09:55:21 -05:00
scan_args [Feature #18249] Update dependencies 2022-02-22 09:55:21 -05:00
st [Feature #18249] Update dependencies 2022-02-22 09:55:21 -05:00
string [Feature #18249] Update dependencies 2022-02-22 09:55:21 -05:00
struct [Feature #18249] Update dependencies 2022-02-22 09:55:21 -05:00
symbol [Feature #18249] Update dependencies 2022-02-22 09:55:21 -05:00
thread/instrumentation [Feature #18339] GVL Instrumentation API 2022-06-03 15:13:33 +02:00
thread_fd [Feature #18249] Update dependencies 2022-02-22 09:55:21 -05:00
time [Feature #18249] Update dependencies 2022-02-22 09:55:21 -05:00
tracepoint [Feature #18249] Update dependencies 2022-02-22 09:55:21 -05:00
typeddata [Feature #18249] Update dependencies 2022-02-22 09:55:21 -05:00
vm [Feature #18249] Update dependencies 2022-02-22 09:55:21 -05:00
wait [Feature #18249] Update dependencies 2022-02-22 09:55:21 -05:00
win32 Get rid of defining methods for tests in core classes 2021-01-09 22:38:06 +09:00
auto_ext.rb [ruby/fiddle] Create extconf header for MSVC 2021-09-05 17:31:46 +09:00