From: ko1@...
Date: 2018-08-27T06:55:49+00:00
Subject: [ruby-core:88676] [Ruby trunk Misc#15014] thread.c: use rb_hrtime_scalar for high-resolution time operations

Issue #15014 has been updated by ko1 (Koichi Sasada).


Thanks!

> + * Hi-res monotonic clock.  It is currently nsec resolution, which has over 500 years of range (unsigned).

uint64?

> MY_RUBY_BUILD_MAY_TIME_TRAVEL

what is this?




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

* Author: normalperson (Eric Wong)
* Status: Closed
* 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>