From: Yusuke ENDOH Date: 2011-01-17T22:09:54+09:00 Subject: [ruby-core:34539] Re: [Ruby 1.9-Bug#4285][Open] Ruby don't have asynchrounous exception safe syntax and It should have. Hi, 2011/1/17 Motohiro KOSAKI : > �CPU0(thread x) � � � � � � � � � � CPU1(thread y) � � � � remark > --------------------------------------------------------------------------- > �enter begin block > �[thread construct] � � � � � � � � � � � � � � � � � � � �but no assign y yet > � � � � � � � � � � � � � � � � � � sleep sec > � � � � � � � � � � � � � � � � � � wakeup from sleep > � � � � � � � � � � � � � � � � � � x.raise > �if y � � � � � � � � � � � � � � � � � � � � � � � � � � �return false. (see above) > > > Therefore, CPU0 don't call y.join and leak y's thread resource. What's the resource? I think that the thread will terminate automatically even if it is not join'ed. > But unfortunately, Ruby don't have such language feature. So, We can't write > async-exception-safe code. One of solution is to move timeout module from ruby code > into c code as JRuby does. But I don't think timeout is only asynchrounos exception user. > we also have Interrupt class (for Ctrl-C) and I think we need to allow to write async > exception safe code by ruby. Dr. akr knows a lot about that subject. -- Yusuke Endoh