[#87773] timer thread [was Re: [ruby-alerts:7905] failure alert on trunk-asserts@silicon-docker (NG (r63844))] — Eric Wong <normalperson@...>
> test_all <main>: warning: pthread_create failed for timer: Resource temporarily unavailable, scheduling broken
[#87836] [Ruby trunk Bug#14898] test/lib/test/unit/parallel.rb: TestSocket#test_timestamp stuck sometimes — ko1@...
Issue #14898 has been reported by ko1 (Koichi Sasada).
[email protected] wrote:
On 2018/07/06 18:47, Eric Wong wrote:
[#87847] undefined symbol: mjit_init_p — Leam Hall <leamhall@...>
I pulled Ruby trunk on 3 Jul and am now getting errors similar to the
As I told you, `make install` is needed to make Ruby work. Running
One more reason for https://bugs.ruby-lang.org/issues/13620 maybe? ;)
Benoit Daloze <[email protected]> wrote:
[#87986] [Ruby trunk Feature#14915] Deprecate String#crypt, move implementation to string/crypt — mame@...
Issue #14915 has been updated by mame (Yusuke Endoh).
[email protected] wrote:
normalperson (Eric Wong) wrote:
[#88088] [Ruby trunk Misc#14937] [PATCH] thread_pthread: lazy-spawn timer-thread only on contention — normalperson@...
Issue #14937 has been reported by normalperson (Eric Wong).
[#88104] [Ruby trunk Bug#14898] test/lib/test/unit/parallel.rb: TestSocket#test_timestamp stuck sometimes — ko1@...
Issue #14898 has been updated by ko1 (Koichi Sasada).
[#88173] [Ruby trunk Bug#14950] r64109 thread.c: move ppoll wrapper before thread_pthread.c - Windows compile failure - thread.c — Greg.mpls@...
Issue #14950 has been reported by MSP-Greg (Greg L).
[#88189] [Ruby trunk Bug#14950] r64109 thread.c: move ppoll wrapper before thread_pthread.c - Windows compile failure - thread.c — nobu@...
Issue #14950 has been updated by nobu (Nobuyoshi Nakada).
[#88199] [Ruby trunk Misc#14937] [PATCH] thread_pthread: lazy-spawn timer-thread only on contention — takashikkbn@...
Issue #14937 has been updated by k0kubun (Takashi Kokubun).
[email protected] wrote:
> yet, sky3 had a failure at
> http://ci.rvm.jp/results/trunk@P895/1173951
> > http://ci.rvm.jp/results/trunk@P895/1173951
[ruby-core:88153] [Ruby trunk Misc#14937] [PATCH] thread_pthread: lazy-spawn timer-thread only on contention
Issue #14937 has been updated by MSP-Greg (Greg L).
@normalperson
Eric,
Passed all tests using r64094. TestJIT#test_unload_units has been failing (both in parallel & retry) since it was added. Been meaning to post an issue/bug report about it...
Thanks, Greg
```
——————————————————————————————————————————————————————————————————————————————— Test Results
0 Total Failures/Errors Build No 991 Job Id 6xo1217qns66ktsu
2018-07-28 22:15:31 UTC
test-all 19273 tests, 2240557 assertions, 1 failures, 0 errors, 108 skips, 108 skips shown
test-spec 3607 files, 27958 examples, 209418 expectations, 0 failures, 0 errors, 0 tagged
mspec 3607 files, 27960 examples, 209308 expectations, 0 failures, 0 errors, 0 tagged
test-basic test succeeded
btest PASS all 1386 tests
——————————————————————————————————————————————————————————————————————————————— Summary test-all
19273 tests, 2240557 assertions, 1 failures, 0 errors, 108 skips, 108 skips shown
————————————————————————————————————————————————————————————————— Parallel Tests - 2 Failures
2 TestJIT#test_compile_insn_putstring_concatstrings_tostring = 1.32 s = F
1 TestJIT#test_unload_units = 4.77 s = F
————————————————————————————————————————————————————————————————— Parallel Tests - 1 Error
0 TestIO#test_select_leak = 60.37 s = E
————————————————————————————————————————————————————————————————— After Retry - 1 Failure
ruby/test_jit.rb
TestJIT#test_unload_units Line: 830
Failed to run script with JIT:
```
----------------------------------------
Misc #14937: [PATCH] thread_pthread: lazy-spawn timer-thread only on contention
https://bugs.ruby-lang.org/issues/14937#change-73178
* Author: normalperson (Eric Wong)
* Status: Closed
* Priority: Normal
* Assignee:
----------------------------------------
[ruby-core:87773]
```
thread_pthread: lazy-spawn timer-thread only on contention
To reduce resource use and reduce CI failure; lazy spawn
timer-thread only in processes which use Ruby Threads AND those
Ruby Threads hit contention. Single-threaded Ruby processes
(including forked children) will never have timer-thread
overhead.
To simplify the thread_pthread.c code, I eliminated busy timer
thread [Misc #14851]. Maybe the thread_win32.c code can use
self-pipe, too; and they won't need busy wakeups.
There is only one self-pipe, now, as wakeups for timeslice are
handled via condition variables. This reduces FD pressure
slightly.
Signal handling is handled directly by one Ruby Thread (instead
of timer-thread) by exposing signal self-pipe to callers of
rb_thread_fd_select, native_sleep, rb_wait_for_single_fd, etc...
Acquiring, using, and releasing the self-pipe is exposed via 4
new internal functions:
1) rb_sigwait_fd_get - exclusively acquire timer_thread_pipe.normal[0]
2) rb_sigwait_fd_sleep - sleep and wait for signal (and no other FDs)
3) rb_sigwait_fd_put - release acquired result from rb_sigwait_fd_get
4) rb_sigwait_fd_migrate - migrate signal handling to another thread
after calling rb_sigwait_fd_put.
rb_sigwait_fd_migrate is necessary for waitpid callers because
only one thread can wait on self-pipe at a time, otherwise a
deadlock will occur if threads fight over the self-pipe.
TRAP_INTERRUPT_MASK is now set for the main thread directly in
signal handler via rb_thread_wakeup_timer_thread.
Originally, I wanted to use POSIX timers
(timer_create/timer_settime) and avoid timer-thread completely.
Unfortunately, this proved unfeasible for one reason:
Mutex#sleep resumes on spurious wakeups and
test/thread/test_cv.rb::test_condvar_timed_wait failed.
In the future, I hope [Feature #14717] is accepted so Threads
may be made non-preemptible. This will allow users to prevent
timer-thread creation completely.
```
git repository also available at:
https://80x24.org/ruby.git tt-lazy
(commit a2990cefccba55300ad44275ee4adf18e6f95ece)
---Files--------------------------------
0001-thread_pthread-lazy-spawn-timer-thread-only-on-conte.patch (42.3 KB)
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:[email protected]?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>