Ruby: ractor_core.h Source File

Ruby 3.0.5p211 (2022-11-24 revision ba5cf0f7c52d4d35cc6a173c89eda98ceffa2dcf)

ractor_core.h
Go to the documentation of this file.
1#include "ruby/ruby.h"
2#include "ruby/ractor.h"
3#include "vm_core.h"
4#include "id_table.h"
5#include "vm_debug.h"
6
7#ifndef RACTOR_CHECK_MODE
8#define RACTOR_CHECK_MODE (0 || VM_CHECK_MODE || RUBY_DEBUG)
9#endif
10
11 enum rb_ractor_basket_type {
12 basket_type_none,
13 basket_type_ref,
14 basket_type_copy,
15 basket_type_move,
16 basket_type_will,
17 basket_type_deleted,
18 basket_type_reserved,
19};
20
21 struct rb_ractor_basket {
22 bool exception;
23 enum rb_ractor_basket_type type;
24 VALUE v;
25 VALUE sender;
26};
27
28 struct rb_ractor_queue {
29 struct rb_ractor_basket *baskets;
30 int start;
31 int cnt;
32 int size;
33 unsigned int serial;
34 unsigned int reserved_cnt;
35};
36
37 struct rb_ractor_waiting_list {
38 int cnt;
39 int size;
40 rb_ractor_t **ractors;
41};
42
43 struct rb_ractor_sync {
44 // ractor lock
45 rb_nativethread_lock_t lock;
46#if RACTOR_CHECK_MODE > 0
47 VALUE locked_by;
48#endif
49 rb_nativethread_cond_t cond;
50
51 // communication
52 struct rb_ractor_queue incoming_queue;
53 struct rb_ractor_waiting_list taking_ractors;
54
55 bool incoming_port_closed;
56 bool outgoing_port_closed;
57
58 struct ractor_wait {
59 enum ractor_wait_status {
60 wait_none = 0x00,
61 wait_receiving = 0x01,
62 wait_taking = 0x02,
63 wait_yielding = 0x04,
64 wait_moving = 0x08,
65 } status;
66
67 enum ractor_wakeup_status {
68 wakeup_none,
69 wakeup_by_send,
70 wakeup_by_yield,
71 wakeup_by_take,
72 wakeup_by_close,
73 wakeup_by_interrupt,
74 wakeup_by_retry,
75 } wakeup_status;
76
77 struct rb_ractor_basket yielded_basket;
78 struct rb_ractor_basket taken_basket;
79 } wait;
80};
81
82 struct rb_ractor_struct {
83 struct rb_ractor_pub pub;
84
85 struct rb_ractor_sync sync;
86 VALUE receiving_mutex;
87 bool yield_atexit;
88
89 // vm wide barrier synchronization
90 rb_nativethread_cond_t barrier_wait_cond;
91
92 // thread management
93 struct {
94 struct list_head set;
95 unsigned int cnt;
96 unsigned int blocking_cnt;
97 unsigned int sleeper;
98 rb_global_vm_lock_t gvl;
99 rb_execution_context_t *running_ec;
100 rb_thread_t *main;
101 } threads;
102 VALUE thgroup_default;
103
104 VALUE name;
105 VALUE loc;
106
107 // created
108 // | ready to run
109 // ====================== inserted to vm->ractor
110 // v
111 // blocking <---+ all threads are blocking
112 // | |
113 // v |
114 // running -----+
115 // | all threads are terminated.
116 // ====================== removed from vm->ractor
117 // v
118 // terminated
119 //
120 // status is protected by VM lock (global state)
121
122 enum ractor_status {
123 ractor_created,
124 ractor_running,
125 ractor_blocking,
126 ractor_terminated,
127 } status_;
128
129 struct list_node vmlr_node;
130
131 // ractor local data
132
133 st_table *local_storage;
134 struct rb_id_table *idkey_local_storage;
135
136 VALUE r_stdin;
137 VALUE r_stdout;
138 VALUE r_stderr;
139 VALUE verbose;
140 VALUE debug;
141
142 rb_ractor_newobj_cache_t newobj_cache;
143
144 // gc.c rb_objspace_reachable_objects_from
145 struct gc_mark_func_data_struct {
146 void *data;
147 void (*mark_func)(VALUE v, void *data);
148 } *mfd;
149}; // rb_ractor_t is defined in vm_core.h
150
151
152static inline VALUE
153rb_ractor_self(const rb_ractor_t *r)
154{
155 return r->pub.self;
156}
157
158 rb_ractor_t *rb_ractor_main_alloc(void);
159void rb_ractor_main_setup(rb_vm_t *vm, rb_ractor_t *main_ractor, rb_thread_t *main_thread);
160void rb_ractor_atexit(rb_execution_context_t *ec, VALUE result);
161void rb_ractor_atexit_exception(rb_execution_context_t *ec);
162void rb_ractor_teardown(rb_execution_context_t *ec);
163void rb_ractor_receive_parameters(rb_execution_context_t *ec, rb_ractor_t *g, int len, VALUE *ptr);
164void rb_ractor_send_parameters(rb_execution_context_t *ec, rb_ractor_t *g, VALUE args);
165
166 VALUE rb_thread_create_ractor(rb_ractor_t *g, VALUE args, VALUE proc); // defined in thread.c
167
168 rb_global_vm_lock_t *rb_ractor_gvl(rb_ractor_t *);
169int rb_ractor_living_thread_num(const rb_ractor_t *);
170 VALUE rb_ractor_thread_list(rb_ractor_t *r);
171
172void rb_ractor_living_threads_init(rb_ractor_t *r);
173void rb_ractor_living_threads_insert(rb_ractor_t *r, rb_thread_t *th);
174void rb_ractor_living_threads_remove(rb_ractor_t *r, rb_thread_t *th);
175void rb_ractor_blocking_threads_inc(rb_ractor_t *r, const char *file, int line); // TODO: file, line only for RUBY_DEBUG_LOG
176void rb_ractor_blocking_threads_dec(rb_ractor_t *r, const char *file, int line); // TODO: file, line only for RUBY_DEBUG_LOG
177
178void rb_ractor_vm_barrier_interrupt_running_thread(rb_ractor_t *r);
179void rb_ractor_terminate_interrupt_main_thread(rb_ractor_t *r);
180void rb_ractor_terminate_all(void);
181bool rb_ractor_main_p_(void);
182void rb_ractor_finish_marking(void);
183 void rb_ractor_atfork(rb_vm_t *vm, rb_thread_t *th);
184
185 VALUE rb_ractor_ensure_shareable(VALUE obj, VALUE name);
186
187RUBY_SYMBOL_EXPORT_BEGIN
188bool rb_ractor_shareable_p_continue(VALUE obj);
189
190// THIS FUNCTION SHOULD NOT CALL WHILE INCREMENTAL MARKING!!
191// This function is for T_DATA::free_func
192void rb_ractor_local_storage_delkey(rb_ractor_local_key_t key);
193
194RUBY_SYMBOL_EXPORT_END
195
196static inline bool
197rb_ractor_main_p(void)
198{
199 if (ruby_single_main_ractor) {
200 return true;
201 }
202 else {
203 return rb_ractor_main_p_();
204 }
205}
206
207static inline bool
208rb_ractor_status_p(rb_ractor_t *r, enum ractor_status status)
209{
210 return r->status_ == status;
211}
212
213static inline void
214rb_ractor_sleeper_threads_inc(rb_ractor_t *r)
215{
216 r->threads.sleeper++;
217}
218
219static inline void
220rb_ractor_sleeper_threads_dec(rb_ractor_t *r)
221{
222 r->threads.sleeper--;
223}
224
225static inline void
226rb_ractor_sleeper_threads_clear(rb_ractor_t *r)
227{
228 r->threads.sleeper = 0;
229}
230
231static inline int
232rb_ractor_sleeper_thread_num(rb_ractor_t *r)
233{
234 return r->threads.sleeper;
235}
236
237static inline void
238rb_ractor_thread_switch(rb_ractor_t *cr, rb_thread_t *th)
239{
240 if (cr->threads.running_ec != th->ec) {
241 if (0) fprintf(stderr, "rb_ractor_thread_switch ec:%p->%p\n",
242 (void *)cr->threads.running_ec, (void *)th->ec);
243 }
244 else {
245 return;
246 }
247
248 if (cr->threads.running_ec != th->ec) {
249 th->running_time_us = 0;
250 }
251
252 cr->threads.running_ec = th->ec;
253
254 VM_ASSERT(cr == GET_RACTOR());
255}
256
257static inline void
258rb_ractor_set_current_ec(rb_ractor_t *cr, rb_execution_context_t *ec)
259{
260#ifdef RB_THREAD_LOCAL_SPECIFIER
261 #if __APPLE__
262 rb_current_ec_set(ec);
263 #else
264 ruby_current_ec = ec;
265 #endif
266#else
267 native_tls_set(ruby_current_ec_key, ec);
268#endif
269
270 if (cr->threads.running_ec != ec) {
271 if (0) fprintf(stderr, "rb_ractor_set_current_ec ec:%p->%p\n",
272 (void *)cr->threads.running_ec, (void *)ec);
273 }
274 else {
275 VM_ASSERT(0); // should be different
276 }
277
278 cr->threads.running_ec = ec;
279}
280
281void rb_vm_ractor_blocking_cnt_inc(rb_vm_t *vm, rb_ractor_t *cr, const char *file, int line);
282void rb_vm_ractor_blocking_cnt_dec(rb_vm_t *vm, rb_ractor_t *cr, const char *file, int line);
283
284static inline uint32_t
285rb_ractor_id(const rb_ractor_t *r)
286{
287 return r->pub.id;
288}
289
290#if RACTOR_CHECK_MODE > 0
291 uint32_t rb_ractor_current_id(void);
292
293static inline void
294rb_ractor_setup_belonging_to(VALUE obj, uint32_t rid)
295{
296 VALUE flags = RBASIC(obj)->flags & 0xffffffff; // 4B
297 RBASIC(obj)->flags = flags | ((VALUE)rid << 32);
298}
299
300static inline void
301rb_ractor_setup_belonging(VALUE obj)
302{
303 rb_ractor_setup_belonging_to(obj, rb_ractor_current_id());
304}
305
306static inline uint32_t
307rb_ractor_belonging(VALUE obj)
308{
309 if (SPECIAL_CONST_P(obj) || RB_OBJ_SHAREABLE_P(obj)) {
310 return 0;
311 }
312 else {
313 return RBASIC(obj)->flags >> 32;
314 }
315}
316
317static inline VALUE
318 rb_ractor_confirm_belonging(VALUE obj)
319{
320 uint32_t id = rb_ractor_belonging(obj);
321
322 if (id == 0) {
323 if (UNLIKELY(!rb_ractor_shareable_p(obj))) {
324 rp(obj);
325 rb_bug("id == 0 but not shareable");
326 }
327 }
328 else if (UNLIKELY(id != rb_ractor_current_id())) {
329 if (rb_ractor_shareable_p(obj)) {
330 // ok
331 }
332 else {
333 rp(obj);
334 rb_bug("rb_ractor_confirm_belonging object-ractor id:%u, current-ractor id:%u", id, rb_ractor_current_id());
335 }
336 }
337 return obj;
338}
339#else
340#define rb_ractor_confirm_belonging(obj) obj
341#endif
ptr
struct RIMemo * ptr
Definition: debug.c:88
g
struct @77 g
len
uint8_t len
Definition: escape.c:17
UNLIKELY
#define UNLIKELY(x)
Definition: ffi_common.h:126
rb_bug
void rb_bug(const char *fmt,...)
Definition: error.c:768
id_table.h
rp
#define rp(obj)
Definition: internal.h:95
name
const char * name
Definition: nkf.c:208
key
key
Definition: openssl_missing.h:185
ractor.h
RB_OBJ_SHAREABLE_P
#define RB_OBJ_SHAREABLE_P(obj)
Definition: ractor.h:50
rb_ractor_main_alloc
rb_ractor_t * rb_ractor_main_alloc(void)
Definition: ractor.c:1508
rb_ractor_local_storage_delkey
void rb_ractor_local_storage_delkey(rb_ractor_local_key_t key)
Definition: ractor.c:3112
rb_ractor_ensure_shareable
VALUE rb_ractor_ensure_shareable(VALUE obj, VALUE name)
Definition: ractor.c:2518
rb_ractor_basket_type
rb_ractor_basket_type
Definition: ractor_core.h:11
basket_type_will
@ basket_type_will
Definition: ractor_core.h:16
basket_type_copy
@ basket_type_copy
Definition: ractor_core.h:14
basket_type_deleted
@ basket_type_deleted
Definition: ractor_core.h:17
basket_type_reserved
@ basket_type_reserved
Definition: ractor_core.h:18
basket_type_none
@ basket_type_none
Definition: ractor_core.h:12
basket_type_ref
@ basket_type_ref
Definition: ractor_core.h:13
basket_type_move
@ basket_type_move
Definition: ractor_core.h:15
rb_ractor_teardown
void rb_ractor_teardown(rb_execution_context_t *ec)
Definition: ractor.c:1652
rb_ractor_terminate_all
void rb_ractor_terminate_all(void)
Definition: ractor.c:1946
rb_ractor_living_threads_insert
void rb_ractor_living_threads_insert(rb_ractor_t *r, rb_thread_t *th)
Definition: ractor.c:1760
rb_ractor_blocking_threads_dec
void rb_ractor_blocking_threads_dec(rb_ractor_t *r, const char *file, int line)
Definition: ractor.c:1870
rb_thread_create_ractor
VALUE rb_thread_create_ractor(rb_ractor_t *g, VALUE args, VALUE proc)
Definition: thread.c:1130
rb_vm_ractor_blocking_cnt_dec
void rb_vm_ractor_blocking_cnt_dec(rb_vm_t *vm, rb_ractor_t *cr, const char *file, int line)
Definition: ractor.c:1798
rb_ractor_atfork
void rb_ractor_atfork(rb_vm_t *vm, rb_thread_t *th)
rb_ractor_send_parameters
void rb_ractor_send_parameters(rb_execution_context_t *ec, rb_ractor_t *g, VALUE args)
Definition: ractor.c:1690
rb_ractor_receive_parameters
void rb_ractor_receive_parameters(rb_execution_context_t *ec, rb_ractor_t *g, int len, VALUE *ptr)
Definition: ractor.c:1682
rb_ractor_blocking_threads_inc
void rb_ractor_blocking_threads_inc(rb_ractor_t *r, const char *file, int line)
Definition: ractor.c:1858
rb_ractor_main_p_
bool rb_ractor_main_p_(void)
Definition: ractor.c:1699
rb_ractor_finish_marking
void rb_ractor_finish_marking(void)
Definition: ractor.c:3215
rb_ractor_living_threads_remove
void rb_ractor_living_threads_remove(rb_ractor_t *r, rb_thread_t *th)
Definition: ractor.c:1838
rb_ractor_gvl
rb_global_vm_lock_t * rb_ractor_gvl(rb_ractor_t *)
Definition: ractor.c:1715
rb_ractor_atexit_exception
void rb_ractor_atexit_exception(rb_execution_context_t *ec)
Definition: ractor.c:1675
rb_ractor_vm_barrier_interrupt_running_thread
void rb_ractor_vm_barrier_interrupt_running_thread(rb_ractor_t *r)
Definition: ractor.c:1892
rb_ractor_atexit
void rb_ractor_atexit(rb_execution_context_t *ec, VALUE result)
Definition: ractor.c:1668
rb_ractor_thread_list
VALUE rb_ractor_thread_list(rb_ractor_t *r)
Definition: ractor.c:1727
rb_ractor_terminate_interrupt_main_thread
void rb_ractor_terminate_interrupt_main_thread(rb_ractor_t *r)
Definition: ractor.c:1911
rb_ractor_living_threads_init
void rb_ractor_living_threads_init(rb_ractor_t *r)
Definition: ractor.c:1546
rb_ractor_confirm_belonging
#define rb_ractor_confirm_belonging(obj)
Definition: ractor_core.h:340
rb_ractor_shareable_p_continue
bool rb_ractor_shareable_p_continue(VALUE obj)
Definition: ractor.c:2550
rb_ractor_main_setup
void rb_ractor_main_setup(rb_vm_t *vm, rb_ractor_t *main_ractor, rb_thread_t *main_thread)
Definition: ractor.c:1581
rb_ractor_living_thread_num
int rb_ractor_living_thread_num(const rb_ractor_t *)
Definition: ractor.c:1721
rb_vm_ractor_blocking_cnt_inc
void rb_vm_ractor_blocking_cnt_inc(rb_vm_t *vm, rb_ractor_t *cr, const char *file, int line)
Definition: ractor.c:1790
RBASIC
#define RBASIC(obj)
Definition: rbasic.h:34
ruby.h
uint32_t
unsigned int uint32_t
Definition: sha2.h:101
SPECIAL_CONST_P
#define SPECIAL_CONST_P
Definition: special_consts.h:47
file
Definition: gzappend.c:170
ractor_newobj_cache
Definition: gc.h:64
rb_execution_context_struct
Definition: vm_core.h:854
rb_global_vm_lock_struct
Definition: thread_pthread.h:45
rb_id_table
Definition: id_table.c:41
rb_ractor_basket
Definition: ractor_core.h:21
rb_ractor_basket::exception
bool exception
Definition: ractor_core.h:22
rb_ractor_basket::type
enum rb_ractor_basket_type type
Definition: ractor_core.h:23
rb_ractor_basket::v
VALUE v
Definition: ractor_core.h:24
rb_ractor_basket::sender
VALUE sender
Definition: ractor_core.h:25
rb_ractor_local_key_struct
Definition: ractor.c:3007
rb_ractor_pub
Definition: vm_core.h:1988
rb_ractor_pub::id
uint32_t id
Definition: vm_core.h:1990
rb_ractor_pub::self
VALUE self
Definition: vm_core.h:1989
rb_ractor_queue
Definition: ractor_core.h:28
rb_ractor_queue::baskets
struct rb_ractor_basket * baskets
Definition: ractor_core.h:29
rb_ractor_queue::start
int start
Definition: ractor_core.h:30
rb_ractor_queue::cnt
int cnt
Definition: ractor_core.h:31
rb_ractor_queue::serial
unsigned int serial
Definition: ractor_core.h:33
rb_ractor_queue::size
int size
Definition: ractor_core.h:32
rb_ractor_queue::reserved_cnt
unsigned int reserved_cnt
Definition: ractor_core.h:34
rb_ractor_struct::gc_mark_func_data_struct
Definition: ractor_core.h:145
rb_ractor_struct::gc_mark_func_data_struct::mark_func
void(* mark_func)(VALUE v, void *data)
Definition: ractor_core.h:147
rb_ractor_struct::gc_mark_func_data_struct::data
void * data
Definition: ractor_core.h:146
rb_ractor_struct
Definition: ractor_core.h:82
rb_ractor_struct::sleeper
unsigned int sleeper
Definition: ractor_core.h:97
rb_ractor_struct::barrier_wait_cond
rb_nativethread_cond_t barrier_wait_cond
Definition: ractor_core.h:90
rb_ractor_struct::r_stdin
VALUE r_stdin
Definition: ractor_core.h:136
rb_ractor_struct::r_stdout
VALUE r_stdout
Definition: ractor_core.h:137
rb_ractor_struct::gvl
rb_global_vm_lock_t gvl
Definition: ractor_core.h:98
rb_ractor_struct::vmlr_node
struct list_node vmlr_node
Definition: ractor_core.h:129
rb_ractor_struct::ractor_status
ractor_status
Definition: ractor_core.h:122
rb_ractor_struct::ractor_created
@ ractor_created
Definition: ractor_core.h:123
rb_ractor_struct::ractor_running
@ ractor_running
Definition: ractor_core.h:124
rb_ractor_struct::ractor_terminated
@ ractor_terminated
Definition: ractor_core.h:126
rb_ractor_struct::ractor_blocking
@ ractor_blocking
Definition: ractor_core.h:125
rb_ractor_struct::main
rb_thread_t * main
Definition: ractor_core.h:100
rb_ractor_struct::blocking_cnt
unsigned int blocking_cnt
Definition: ractor_core.h:96
rb_ractor_struct::thgroup_default
VALUE thgroup_default
Definition: ractor_core.h:102
rb_ractor_struct::cnt
unsigned int cnt
Definition: ractor_core.h:95
rb_ractor_struct::r_stderr
VALUE r_stderr
Definition: ractor_core.h:138
rb_ractor_struct::running_ec
rb_execution_context_t * running_ec
Definition: ractor_core.h:99
rb_ractor_struct::name
VALUE name
Definition: ractor_core.h:104
rb_ractor_struct::local_storage
st_table * local_storage
Definition: ractor_core.h:133
rb_ractor_struct::threads
struct rb_ractor_struct::@141 threads
rb_ractor_struct::debug
VALUE debug
Definition: ractor_core.h:140
rb_ractor_struct::status_
enum rb_ractor_struct::ractor_status status_
rb_ractor_struct::sync
struct rb_ractor_sync sync
Definition: ractor_core.h:85
rb_ractor_struct::pub
struct rb_ractor_pub pub
Definition: ractor_core.h:83
rb_ractor_struct::loc
VALUE loc
Definition: ractor_core.h:105
rb_ractor_struct::mfd
struct rb_ractor_struct::gc_mark_func_data_struct * mfd
rb_ractor_struct::yield_atexit
bool yield_atexit
Definition: ractor_core.h:87
rb_ractor_struct::receiving_mutex
VALUE receiving_mutex
Definition: ractor_core.h:86
rb_ractor_struct::idkey_local_storage
struct rb_id_table * idkey_local_storage
Definition: ractor_core.h:134
rb_ractor_struct::verbose
VALUE verbose
Definition: ractor_core.h:139
rb_ractor_struct::newobj_cache
rb_ractor_newobj_cache_t newobj_cache
Definition: ractor_core.h:142
rb_ractor_sync::ractor_wait
Definition: ractor_core.h:58
rb_ractor_sync::ractor_wait::ractor_wait_status
ractor_wait_status
Definition: ractor_core.h:59
rb_ractor_sync::ractor_wait::wait_yielding
@ wait_yielding
Definition: ractor_core.h:63
rb_ractor_sync::ractor_wait::wait_receiving
@ wait_receiving
Definition: ractor_core.h:61
rb_ractor_sync::ractor_wait::wait_taking
@ wait_taking
Definition: ractor_core.h:62
rb_ractor_sync::ractor_wait::wait_none
@ wait_none
Definition: ractor_core.h:60
rb_ractor_sync::ractor_wait::wait_moving
@ wait_moving
Definition: ractor_core.h:64
rb_ractor_sync::ractor_wait::taken_basket
struct rb_ractor_basket taken_basket
Definition: ractor_core.h:78
rb_ractor_sync::ractor_wait::ractor_wakeup_status
ractor_wakeup_status
Definition: ractor_core.h:67
rb_ractor_sync::ractor_wait::wakeup_by_send
@ wakeup_by_send
Definition: ractor_core.h:69
rb_ractor_sync::ractor_wait::wakeup_by_interrupt
@ wakeup_by_interrupt
Definition: ractor_core.h:73
rb_ractor_sync::ractor_wait::wakeup_by_yield
@ wakeup_by_yield
Definition: ractor_core.h:70
rb_ractor_sync::ractor_wait::wakeup_none
@ wakeup_none
Definition: ractor_core.h:68
rb_ractor_sync::ractor_wait::wakeup_by_close
@ wakeup_by_close
Definition: ractor_core.h:72
rb_ractor_sync::ractor_wait::wakeup_by_take
@ wakeup_by_take
Definition: ractor_core.h:71
rb_ractor_sync::ractor_wait::wakeup_by_retry
@ wakeup_by_retry
Definition: ractor_core.h:74
rb_ractor_sync::ractor_wait::status
enum rb_ractor_sync::ractor_wait::ractor_wait_status status
rb_ractor_sync::ractor_wait::wakeup_status
enum rb_ractor_sync::ractor_wait::ractor_wakeup_status wakeup_status
rb_ractor_sync::ractor_wait::yielded_basket
struct rb_ractor_basket yielded_basket
Definition: ractor_core.h:77
rb_ractor_sync
Definition: ractor_core.h:43
rb_ractor_sync::taking_ractors
struct rb_ractor_waiting_list taking_ractors
Definition: ractor_core.h:53
rb_ractor_sync::wait
struct rb_ractor_sync::ractor_wait wait
rb_ractor_sync::incoming_port_closed
bool incoming_port_closed
Definition: ractor_core.h:55
rb_ractor_sync::incoming_queue
struct rb_ractor_queue incoming_queue
Definition: ractor_core.h:52
rb_ractor_sync::cond
rb_nativethread_cond_t cond
Definition: ractor_core.h:49
rb_ractor_sync::outgoing_port_closed
bool outgoing_port_closed
Definition: ractor_core.h:56
rb_ractor_sync::lock
rb_nativethread_lock_t lock
Definition: ractor_core.h:45
rb_ractor_waiting_list
Definition: ractor_core.h:37
rb_ractor_waiting_list::ractors
rb_ractor_t ** ractors
Definition: ractor_core.h:40
rb_ractor_waiting_list::cnt
int cnt
Definition: ractor_core.h:38
rb_ractor_waiting_list::size
int size
Definition: ractor_core.h:39
rb_thread_cond_struct
Definition: thread_win32.h:24
rb_thread_struct
Definition: vm_core.h:935
rb_thread_struct::ec
rb_execution_context_t * ec
Definition: vm_core.h:941
rb_thread_struct::running_time_us
uint32_t running_time_us
Definition: vm_core.h:964
rb_vm_struct
Definition: vm_core.h:564
st_table
Definition: st.h:79
ruby_current_ec
RB_THREAD_LOCAL_SPECIFIER struct rb_execution_context_struct * ruby_current_ec
ruby_current_ec_key
native_tls_key_t ruby_current_ec_key
Definition: vm.c:400
VALUE
unsigned long VALUE
Definition: value.h:38
ruby_single_main_ractor
rb_ractor_t * ruby_single_main_ractor
Definition: vm.c:381
vm_core.h
VM_ASSERT
#define VM_ASSERT(expr)
Definition: vm_core.h:61
vm_debug.h