Deadlock detection when main thread calls Thread.stop

e$B$3$s$P$s$O!"e(Bsheepman e$B$G$9!#e(B

e$B:Y$+$$OC$G$9$,!#7k2LE*$K%a%$%s%9%l%C%[email protected]$1$,e(B Thread.stop
e$B$7$F$$$k>uBV$Ke(B
e$B$J$C$?;~$K!“e(Bdeadlock
e$B$NNc30$,H/@8$7$J$$$N$O$=$&$$$&$b$N$J$N$G$7$g$&$+!#e(B
e$B%a%$%s%9%l%C%I0J30$Ke(B Thread.stop
e$B$7$F$$$k%9%l%C%I$,$b$&$R$H$D$”$C$?>l9g$O!"e(B
deadlock e$B$NNc30$,H/@8$7$^$9!#e(B

e$B2?$+8!=P$9$k%G%C%I%m%C%/$N4p=`$_$?$$$J$b$N$O$"$k$N$G$7$g$&$+!#$"$l$P%j%U%!%l%s%9$Ke(B
e$B=q$-B-$7$F$*$-$^$9!#e(B

$ cat dlck2.rb
Thread.new do
sleep 1
end

sleep 0.1
Thread.stop

$ ruby-1.8 -v dlck2.rb
ruby 1.8.6 (2007-06-18 patchlevel 5000) [i686-linux]
(e$B%G%C%I%m%C%/H/@8e(B)

$ cat dlck3.rb
Thread.new do
sleep 1
p 3
end

Thread.new do
sleep 0.1
p 1
Thread.stop
end

sleep 0.5
p 2
Thread.stop

$ ruby-1.8 -v dlck3.rb
ruby 1.8.6 (2007-06-18 patchlevel 5000) [i686-linux]
1
2
3
deadlock 0x4022e6fc: sleep:- (main) - dlck3.rb:14
deadlock 0x40221830: sleep:- - dlck3.rb:9
dlck3.rb:1: Thread(0x40221894): deadlock (fatal)

e$B$^$D$b$He(B e$B$f$-$R$m$G$9e(B

In message “Re: [ruby-dev:31039] deadlock detection when main thread
calls Thread.stop”
on Sat, 23 Jun 2007 23:34:54 +0900, sheepman
[email protected] writes:

|e$B:Y$+$$OC$G$9$,!#7k2LE*$K%a%$%s%9%l%C%[email protected]$1$,e(B Thread.stop e$B$7$F$$$k>uBV$Ke(B
|e$B$J$C$?;~$K!“e(Bdeadlock e$B$NNc30$,H/@8$7$J$$$N$O$=$&$$$&$b$N$J$N$G$7$g$&$+!#e(B
|e$B%a%$%s%9%l%C%I0J30$Ke(B Thread.stop e$B$7$F$$$k%9%l%C%I$,$b$&$R$H$D$”$C$?>l9g$O!“e(B
|deadlock e$B$NNc30$,H/@8$7$^$9!#e(B
|
|e$B2?$+8!=P$9$k%G%C%I%m%C%/$N4p=`$_$?$$$J$b$N$O$”$k$N$G$7$g$&$+!#$"$l$P%j%U%!%l%s%9$Ke(B
|e$B=q$-B-$7$F$*$-$^$9!#e(B

e$B4p=`$O!"e(B

  • e$BJ#?t%9%l%C%I$,$"$ke(B
  • e$B$9$Y$F$,e(Bstope$B>uBVe(B(waite$B$G$J$$e(B)

e$B$G$9!#C10l%9%l%C%I$N>l9g!"e(Bsleep forevere$B$H$*[email protected]$m$&$H$$$&e(B
e$B$3$H$G%G%C%I%m%C%/$K$7$F$^$;$s!#e(B

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs