[ruby-cvs:73482] normal:r66381 (trunk): thread_pthread.c (native_sleep): sched_yield if GVL uncontended

normal at ruby-lang.org normal at ruby-lang.org
Thu Dec 13 18:25:47 JST 2018


normal	2018-12-13 18:25:46 +0900 (Thu, 13 Dec 2018)

  New Revision: 66381

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=66381

  Log:
    thread_pthread.c (native_sleep): sched_yield if GVL uncontended
    
    Uncontended GVL waitqueue could mean a single CPU setup where
    threads are starved and can't even insert themselves into our
    waitqueue.  So we force other threads to run upon releasing
    the GVL in an uncontended state, in the hope that we can
    avoid entering the slow path of ppoll and similar syscalls.
    
    This should prevent test/ruby/test_thread.rb::test_signal_at_join
    timeout problems on our single CPU FreeBSD CI machine.
    
    [ruby-core:90417] [Bug #15398]

  Modified files:
    trunk/thread_pthread.c


More information about the ruby-cvs mailing list