[#40961] [Bug #3137] complex.rb changes exceptions of Math — Yusuke Endoh <redmine@...>

Bug #3137: complex.rb changes exceptions of Math

15 messages 2010/04/12

[#41038] Windows と DL が使用条件の libffi — Aaron Patterson <aaron.patterson@...>

こんにちは!アーロンです。

17 messages 2010/04/22
[#41039] Re: Windows と DL が使用条件の libffi — "U.Nakamura" <usa@...> 2010/04/22

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

[#41040] Re: Windows と DL が使用条件の libffi — "NARUSE, Yui" <naruse@...> 2010/04/22

成瀬です。

[#41059] Re: Windows と DL が使用条件の libffi — Aaron Patterson <aaron.patterson@...> 2010/04/26

2010/4/21 NARUSE, Yui <naruse@airemix.jp>:

[#41060] Re: Windows と DL が使用条件の libffi — Yugui <yugui@...> 2010/04/26

2010/4/26 Aaron Patterson <aaron.patterson@gmail.com>:

[#41067] [Feature #3203] LazySweepGC patch — Narihiro Nakamura <redmine@...>

Feature #3203: LazySweepGC patch

15 messages 2010/04/26
[#41069] Re: [Feature #3203] LazySweepGC patch — Yusuke ENDOH <mame@...> 2010/04/27

遠藤です。

[#41104] Rails3 M17N — Yukihiro Matsumoto <matz@...>

まつもと ゆきひろです

29 messages 2010/04/30
[#41111] Re: Rails3 M17N — Urabe Shyouhei <shyouhei@...> 2010/04/30

Yukihiro Matsumoto さんは書きました:

[#41113] Re: Rails3 M17N — Yukihiro Matsumoto <matz@...> 2010/04/30

まつもと ゆきひろです

[ruby-dev:40977] [Bug #812] Failure: test_priority (TestThread) on mswin32

From: Yusuke Endoh <redmine@...>
Date: 2010-04-13 15:44:30 UTC
List: ruby-dev #40977
チケット #812 が更新されました。 (by Yusuke Endoh)

担当者 Koichi SasadaからYusuke Endohに変更
Target version 1.9.2にセット
ruby -v -にセット

遠藤です。

2008年12月3日12:46 U.Nakamura <usa@garbagecollect.jp>:
> 表題の通りですが、priorityの低いスレッドの選択率を下げる機構
> はpthreadでもwin32でも同じなのに、win32だとまともに機能してい
> ないように見えるのはなぜでしょうか?

この機構は、native_thread_yield() を呼んだときに極力他のスレッドに
コンテキストスイッチしてくれないと働きません。
thread_win32.c では native_thread_yield() は Sleep(0) となっていて、
Sleep(0) は MSDN によると

> 中断時間として 0ms を指定してこの関数を呼び出すと、現在のスレッドは
> 自らに割り当てられているタイムスライスの残りの部分を放棄します。

らしいので、これが本当なら動きそうなものですが、どうなんでしょうね。


いずれにしても、このテストはプラットフォームとタイミングに強く依存
するのであまり適切でなかったかもしれません。すでになかださんによって
コメントアウトされているので、解決していると思います。


Thread#priority, #priority= の rdoc は、高優先度のスレッドがいる限り
低優先度のスレッドが全く実行されないかのように読めるので、これを修正
しつつ、プラットフォームによっては無視されるということを書いて、この
チケットはクローズします。


diff --git a/thread.c b/thread.c
index 10d6047..40a3483 100644
--- a/thread.c
+++ b/thread.c
@@ -2142,8 +2142,11 @@ rb_thread_keys(VALUE self)
  *
  *  Returns the priority of <i>thr</i>. Default is inherited from the
  *  current thread which creating the new thread, or zero for the
- *  initial main thread; higher-priority threads will run before
- *  lower-priority threads.
+ *  initial main thread; higher-priority thread will run more frequently
+ *  than lower-priority threads (but lower-priority threads can also run).
+ *
+ *  This is just hint for Ruby thread scheduler.  It may be ignored on some
+ *  platform.
  *
  *     Thread.current.priority   #=> 0
  */
@@ -2162,7 +2165,11 @@ rb_thread_priority(VALUE thread)
  *     thr.priority= integer   => thr
  *
  *  Sets the priority of <i>thr</i> to <i>integer</i>. Higher-priority threads
- *  will run before lower-priority threads.
+ *  will run more frequently than lower-priority threads (but lower-priority
+ *  threads can also run).
+ *
+ *  This is just hint for Ruby thread scheduler.  It may be ignored on some
+ *  platform.
  *
  *     count1 = count2 = 0
  *     a = Thread.new do

-- 
Yusuke Endoh <mame@tsg.ne.jp>
----------------------------------------
http://redmine.ruby-lang.org/issues/show/812

----------------------------------------
http://redmine.ruby-lang.org

In This Thread