https://bugs.ruby-lang.org/https://bugs.ruby-lang.org/favicon.ico?17113305112017-10-26T08:33:01ZRuby Issue Tracking SystemRuby master - Feature #14038: Use rb_execution_context_t instead of rb_thread_t to represent execution contexthttps://bugs.ruby-lang.org/issues/14038?journal_id=676022017-10-26T08:33:01Zko1 (Koichi Sasada)
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>Closed</i></li></ul><p>Applied in changeset trunk|r60440.</p>
<hr>
<p>Use rb_execution_context_t instead of rb_thread_t<br>
to represent execution context [Feature <a class="issue tracker-2 status-5 priority-4 priority-default closed" title="Feature: Use rb_execution_context_t instead of rb_thread_t to represent execution context (Closed)" href="https://bugs.ruby-lang.org/issues/14038">#14038</a>]</p>
<ul>
<li>
<p>vm_core.h (rb_thread_t): rb_thread_t::ec is now a pointer.<br>
There are many code using <code>th</code> to represent execution context<br>
(such as cfp, VM stack and so on). To access <code>ec</code>, they need to<br>
use <code>th->ec->...</code> (adding one indirection) so that we need to<br>
replace them by passing <code>ec</code> instead of <code>th</code>.</p>
</li>
<li>
<p>vm_core.h (GET_EC()): introduced to access current ec. Also<br>
remove <code>ruby_current_thread</code> global variable.</p>
</li>
<li>
<p>cont.c (rb_context_t): introduce rb_context_t::thread_ptr instead of<br>
rb_context_t::thread_value.</p>
</li>
<li>
<p>cont.c (ec_set_vm_stack): added to update vm_stack explicitly.</p>
</li>
<li>
<p>cont.c (ec_switch): added to switch ec explicitly.</p>
</li>
<li>
<p>cont.c (rb_fiber_close): added to terminate fibers explicitly.</p>
</li>
</ul> Ruby master - Feature #14038: Use rb_execution_context_t instead of rb_thread_t to represent execution contexthttps://bugs.ruby-lang.org/issues/14038?journal_id=748812018-11-15T20:15:23Zaselder (Andrew Selder)aselder@mac.com
<ul></ul><p>FWIW, this changed seems to cause SegFaults on a regular basis on OS X</p>
<p><a href="https://bugs.ruby-lang.org/issues/14714" class="external">https://bugs.ruby-lang.org/issues/14714</a><br>
<a href="https://bugs.ruby-lang.org/issues/14561" class="external">https://bugs.ruby-lang.org/issues/14561</a><br>
<a href="https://bugs.ruby-lang.org/issues/15308" class="external">https://bugs.ruby-lang.org/issues/15308</a><br>
<a href="https://bugs.ruby-lang.org/issues/14334" class="external">https://bugs.ruby-lang.org/issues/14334</a></p>