Issue #15014 has been updated by MSP-Greg (Greg L).


@normalperson Eric,

At r64493, ruby-loco built successfully using the abiove patch, Thanks, Greg

----------------------------------------
Misc #15014: thread.c: use rb_hrtime_scalar for high-resolution time operations
https://bugs.ruby-lang.org/issues/15014#change-73652

* Author: normalperson (Eric Wong)
* Status: Open
* Priority: Normal
* Assignee: 
----------------------------------------
thread.c: use rb_hrtime_t scalar for high-resolution time operations

Relying on "struct timespec" was too annoying API-wise and
used more stack space.  "double" was a bit wacky w.r.t rounding
in the past, so now we'll switch to using a 64-bit type.

Unsigned 64-bit integer is able to give us over nearly 585
years of range with nanoseconds.  This range is good enough
for the Linux kernel internal time representation, so it
ought to be good enough for us.

This reduces the stack usage of functions while GVL is held
(and thus subject to marking) on x86-64 Linux (with ppoll):

    rb_wait_for_single_fd    120 => 104
    do_select                120 => 88

I plan on using this for Timeout-in-VM [Feature #14859] and
auto-fiber [Feature #13618].


---Files--------------------------------
0001-thread.c-use-rb_hrtime_t-scalar-for-high-resolution-.patch (30.2 KB)


-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>