Issue #3674 has been updated by Tomoyuki Chikanaga.

Category set to lib
Status changed from Assigned to Closed

kill_sub_thread ???????c?????ч???????障?????
----------------------------------------
Bug #3674: dRuby ??泣?若????????祉?鴻?????罩≪????????????????????????????????????????
http://redmine.ruby-lang.org/issues/3674

Author: Tomoyuki Chikanaga
Status: Closed
Priority: Normal
Assignee: Masatoshi Seki
Category: lib
Target version: 1.9.3
ruby -v: ruby 1.9.3dev (2010-08-05 trunk 28840) [i686-linux]


=begin
 CentOS release 5.4 Linux ??????激?潟?? dRuby ???泣?若????????祉?鴻?????罩≪?????????????? CPU ??????????倶?????
 ??亥?????????????亥??腮?綺????????????????????????????????障?????
 Redhat Enterprise Linux, Ubuntu 8.10, openSUSE 11.1 膈????????医????у???????????????????????????障?????
 篁??????????????膠?????帥???????????? CentOS ???????????????????????с?????
 (CPU ??腮蕁?/???綺?? libpthread ??????若?吾?с?潟????違??????с????綵??帥??????????????????????障?????)
 
 ?????????遺札筝???????????泣?潟?????с??腮????榊???????障?????
 
 * server.rb
 require "drb"
 
 class S
   def m1
     puts "S#m1 called"
     sleep 10
   end
 end
 
 begin
   front = S.new
   uri = ARGV[0] || "druby://localhost:0"
   puts DRb.start_service(uri, front).uri
 
   DRb.thread.join
 rescue Interrupt
 ensure
   DRb.stop_service
 end
 
 * client.rb
 require "drb"
 
 obj = DRbObject.new_with_uri ARGV[0]
 obj.m1
 
 * 絎?茵?箴?
 $ ruby server.rb druby://localhost:10000
 druby://localhost:10000
 S#m1 called
  <- Ctrl-C ??т賢???
 
 (??ョ???у??茵?)
 $ ruby client.rb druby://localhost:10000
 
 ??榊?????????????? gdb attach ??????帥????? DRbServer#kill_sub_thread ??? dRuby 荀?羆??????????????????
 Thread ??? kill ?????????c???????????????ф??障?c??????????????с?????
 篁ヤ???????????? Thread.pass ?????水?ャ????????榊??????????????障????????
 
 Index: lib/drb/drb.rb
 ===================================================================
 --- lib/drb/drb.rb      (revision 28880)
 +++ lib/drb/drb.rb      (working copy)
 @@ -1421,6 +1421,7 @@
           list.each do |th|
             th.kill if th.alive?
           end
 +         Thread.pass
           list = @grp.list
         end
        end
=end



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