Feature #7390

Funny Falcon Threads

Added by Zachary Scott over 4 years ago. Updated over 1 year ago.

Target version:


From github:

(1) Currently, when Thread wakes on timeout, it could not remove itself from ConditionVariable waiters until it acquires lock. So that, when ConditionVariable#signal is called, it will try to wakeup such thread, instead of some one else.

Simple way to avoid it, is to allow Mutex#sleep to recieve a block, which will be called right after Thread will awake, but before Mutex will be tried to lock

(2) Since MatzRuby use GVL for thread isolation, and native method could not be interrupted (unless it wish), we could remove couple of calles to Mutex#synchronize

(3) Usage of hash with compare_by_identity allows remove call to Array#include? in a Queue. Also it allows to remove other call Mutex#synchronize from ConditionVariable#wait in case when we rely on GVL.

(4) And cosmetic changes to SizedQueue

funny_falcon_threads.patch View (15.2 KB) Zachary Scott, 11/19/2012 08:35 AM


#1 [ruby-core:49599] Updated by Yusuke Endoh over 4 years ago

  • Status changed from Open to Assigned
  • Assignee changed from Yusuke Endoh to Koichi Sasada
  • Target version set to next minor

ko1, could you consider this issue towards next minor?

Yusuke Endoh

#2 [ruby-core:49622] Updated by Koichi Sasada over 4 years ago

(2012/11/20 3:12), mame (Yusuke Endoh) wrote:

ko1, could you consider this issue towards next minor?


// SASADA Koichi at atdot dot net

#3 Updated by Koichi Sasada over 1 year ago

  • Status changed from Assigned to Closed

Now, thread.rb is ported to thread_tools.c.

Also available in: Atom PDF