Project

General

Profile

Actions

Feature #7390

closed

Funny Falcon Threads

Added by zzak (zzak _) over 11 years ago. Updated over 8 years ago.

Status:
Closed
Target version:
-
[ruby-core:49543]

Description

=begin
From github: https://github.com/ruby/ruby/pull/104

(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
=end


Files

funny_falcon_threads.patch (15.2 KB) funny_falcon_threads.patch zzak (zzak _), 11/19/2012 08:35 AM
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0