Project

General

Profile

Bug #6098

Re: GVL改善案

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

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

Description

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

In message "[ruby-dev:43483] Re: GVL改善案"
on May.09,2011 07:19:30, matz@ruby-lang.org 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 usa@garbagecollect.jp


Related issues

Related to Backport200 - Backport #7999: bootstarap test hungs at threading testsClosed03/02/2013Actions

Associated revisions

Revision fea7a74e
Added by usa (Usaku NAKAMURA) over 7 years ago

  • 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]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35163 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 35163
Added by usa (Usaku NAKAMURA) over 7 years ago

  • 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]

Revision 35163
Added by usa (Usaku NAKAMURA) over 7 years ago

  • 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]

Revision 35163
Added by usa (Usaku NAKAMURA) over 7 years ago

  • 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]

Revision 35163
Added by usa (Usaku NAKAMURA) over 7 years ago

  • 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]

Revision 35163
Added by usa (Usaku NAKAMURA) over 7 years ago

  • 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]

Revision 35163
Added by usa (Usaku NAKAMURA) over 7 years ago

  • 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]

Revision 8e601a20
Added by usa (Usaku NAKAMURA) over 7 years ago

  • thread_win32.c (TIME_QUANTUM_USEC): 10ms(= old setting) [experimental] cf. [Bug #6098]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35164 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 35164
Added by usa (Usaku NAKAMURA) over 7 years ago

  • thread_win32.c (TIME_QUANTUM_USEC): 10ms(= old setting) [experimental] cf. [Bug #6098]

Revision 35164
Added by usa (Usaku NAKAMURA) over 7 years ago

  • thread_win32.c (TIME_QUANTUM_USEC): 10ms(= old setting) [experimental] cf. [Bug #6098]

Revision 35164
Added by usa (Usaku NAKAMURA) over 7 years ago

  • thread_win32.c (TIME_QUANTUM_USEC): 10ms(= old setting) [experimental] cf. [Bug #6098]

Revision 35164
Added by usa (Usaku NAKAMURA) over 7 years ago

  • thread_win32.c (TIME_QUANTUM_USEC): 10ms(= old setting) [experimental] cf. [Bug #6098]

Revision 35164
Added by usa (Usaku NAKAMURA) over 7 years ago

  • thread_win32.c (TIME_QUANTUM_USEC): 10ms(= old setting) [experimental] cf. [Bug #6098]

Revision 35164
Added by usa (Usaku NAKAMURA) over 7 years ago

  • thread_win32.c (TIME_QUANTUM_USEC): 10ms(= old setting) [experimental] cf. [Bug #6098]

History

Updated by ko1 (Koichi Sasada) over 7 years ago

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

Updated by shyouhei (Shyouhei Urabe) over 7 years ago

  • Status changed from Open to Assigned
#3

Updated by usa (Usaku NAKAMURA) over 7 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]

Also available in: Atom PDF