From: Phy Prabab Date: 2007-02-01T08:04:13+09:00 Subject: Thread dead lock/fatal --0-1023036607-1170284650=:39746 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Hello,=0A=0AI am using 1.8.5p20 (Dec 2006) of ruby using the pickaxe book e= xample of extending GServer and I have come across a fatal that is perhaps = my fault. I run the example code (below) on RHEE30 x86_64 (ruby is 32b) co= nnecting to the server instance on the same machine through a repeat comman= d, as in:=0A=0Arepeat 100 telnet localhost 2000=0A=0AI eventually get this:= =0A=0A[Wed Jan 31 14:52:05 2007] TimeServer 127.0.0.1:2000 client:50838 dis= connect=0Adeadlock 0x2a95ceafa8: sleep:J(0x2a95e514c8) (main) - /lan/rc/too= ls/1.4/lnx64b24c23/ruby185/lib/ruby/1.8/gserver.rb:128=0Adeadlock 0x2a95e51= 4c8: sleep:- - /lan/rc/tools/1.4/lnx64b24c23/ruby185/lib/ruby/1.8/thread.r= b:203=0A[Wed Jan 31 14:52:05 2007] TimeServer 127.0.0.1:2000 stop=0A/lan/rc= /tools/1.4/lnx64b24c23/ruby185/lib/ruby/1.8/gserver.rb:208:in `join': Threa= d(0x2a95e1f298): deadlock (fatal)=0A from ./testserv.rb:22=0A=0A=0AD= oes this look like I am doing something wrong?=0A=0AHere is the code:=0A=0A= cat testserv.rb =0A#!/usr/bin/env ruby=0A=0Arequire 'gserver'=0Arequire 'ti= me'=0A=0Aclass TimeServer < GServer=0A def initialize=0A super(2000)=0A= @count =3D 3=0A end=0A def server(client)=0A client.puts Time.now.= to_s=0A @count -=3D1=0A stop if @count.zero?=0A end=0Aend=0A=0Aserve= r =3D TimeServer.new=0A=0Aserver.audit =3D true=0Aserver.start=0Aserver.joi= n=0A=0A=0AThanks for the help!=0APhy=0A=0A=0A=0A=0A =0A____________________= ________________________________________________________________=0AExpectin= g? Get great news right away with email Auto-Check. =0ATry the Yahoo! Mail = Beta.=0Ahttp://advision.webevents.yahoo.com/mailbeta/newmail_tools.html --0-1023036607-1170284650=:39746--