From: Kenta Murata Date: 2010-11-09T12:23:29+09:00 Subject: [ruby-list:47624] ファイバとスレッド固有データ むらたです。 ファイバの内側と外側は同一スレッドに入っていますが、 以下のコードによってスレッド固有データが分離されている事が 確認されました。 Thread.current[:abc] = 1 fb = Fiber.new do th = Thread.current p [th, th[:abc]] th[:abc] = 2 end th = Thread.current p [th, th[:abc]] #=> [#, 1] fb.resume #=> [#, nil] p [th, th[:abc]] #=> [#, 1] この動作は仕様で決められたものでしょうか? それとも、たまたまこのように実装されてるだけなのでしょうか? -- Kenta Murata OpenPGP FP = 1D69 ADDE 081C 9CC2 2E54 98C1 CEFE 8AFB 6081 B062 本を書きました!! 『Ruby 逆引きレシピ』 http://www.amazon.co.jp/dp/4798119881/mrkn-22 E-mail: mrkn@mrkn.jp twitter: http://twitter.com/mrkn/ blog: http://d.hatena.ne.jp/mrkn/