Project

General

Profile

Actions

Bug #6098

closed

Re: GVL改善案

Added by usa (Usaku NAKAMURA) over 12 years ago. Updated over 12 years ago.

Status:
Closed
Target version:
-
ruby -v:
?
Backport:
[ruby-dev:45294]

Description

こんにちは、なかむら(う)です。

In message "[ruby-dev:43483] Re: GVL改善案"
on May.09,2011 07:19:30, wrote:

|0 until hogehoge
|
|みたいなビジーループ書くとハマるので、これを「直すべき」とするか、
|「言語仕様だ、ユーザは気をつけてスクリプト書きやがれ」とするか決めないと
|いけない。とかとか

「直すべき」でしょう。

いきなり10ヶ月くらい前のネタを蒸し返しますけど、その後r32064
で該当コードが入れられて、以降は250ms(実際は100ms単位でしか判
定されないので300ms)に一度しかスレッドが切り替わらなくなって
います。

簡単な例だとこんな感じ。
ruby -e 'Thread.new{loop{}}; loop{p Time.now.usec; Thread.pass}

ruby-coreでは賞金までかけられてますが([ruby-core:42972])、ず
ばりこれが原因です。

それでは。

U.Nakamura


Related issues 1 (0 open1 closed)

Related to Backport200 - Backport #7999: bootstarap test hungs at threading testsClosednagachika (Tomoyuki Chikanaga)03/02/2013Actions

Updated by ko1 (Koichi Sasada) over 12 years ago

  • Assignee set to kosaki (Motohiro KOSAKI)
  • ruby -v set to ?
Actions #2

Updated by shyouhei (Shyouhei Urabe) over 12 years ago

  • Status changed from Open to Assigned
Actions #3

Updated by usa (Usaku NAKAMURA) over 12 years ago

  • Status changed from Assigned to Closed
  • % Done changed from 0 to 100

This issue was solved with changeset r35163.
Usaku, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


  • thread.c (rb_threadptr_execute_interrupts_common): use defined
    TIME_QUANTUM_USEC instead of a magic number. there is no meanings
    to use different values for checking interval of interruption and
    thread switching limits.
    cf. [Bug #6098]
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0