[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Deadlock?

Philip Mak

9/14/2003 5:59:00 AM

I have a multi-threaded http server. Sometimes, it gets into a state
where it stops responding to requests, and if I press Ctrl+C at the
console it takes a long time to respond. The "ruby -rprofile" shows
this at the top:

% cumulative self self total
time seconds seconds calls ms/call ms/call name
62.65 1.04 1.04 30 34.67 853.00 Thread#stop
9.64 1.20 0.16 37 4.32 18.38 Kernel.require
9.04 1.35 0.15 1 150.00 220.00 IO#each
7.23 1.47 0.12 152 0.79 0.92 Kernel.sleep

I never call Thread#stop explicitly in my program so it's surprising
that Thread#stop takes up so much time... although I do have both
Timeout and Mutex.

Anyone know what to make of this 62.65% time consumption by
Thread#stop? Could it be that somehow my threads are deadlocking each
other?

1 Answer

nobu.nokada

9/15/2003 10:26:00 PM

0

Hi,

At Sun, 14 Sep 2003 14:59:27 +0900,
Philip Mak wrote:
> I never call Thread#stop explicitly in my program so it''s surprising
> that Thread#stop takes up so much time... although I do have both
> Timeout and Mutex.

Mutex uses Thread#stop to wait to be unlocked.

> Anyone know what to make of this 62.65% time consumption by
> Thread#stop? Could it be that somehow my threads are deadlocking each
> other?

Do you define the signal handler?

--
Nobu Nakada