You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Christopher Schultz <ch...@christopherschultz.net> on 2007/06/11 23:27:42 UTC

Re: [OT] Thread Pool

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Siraj,

Siraj Haider wrote:
> Hello, Now I have changed my servlet.  I have created a new class 
> ResultFetcher extended by thread and now I am doing the checking part 
> inside that Thread.run() method.  and calling the new class like this :
> 
>       ResultFetcher rf = new ResultFetcher(something);
>       rf.setDaemon(true);
>       rf.run();

Thread.run does not actually launch the new thread. It merely calls the
"run" method on it, synchronously. If you re-read the javadoc, you'll
see that Thread.start is what you really want to call.

You can ignore the stabbing-in-the-dark advise that others are
attempting to give you... things like setting daemon status and closing
connections are unrelated to this problem (but actually very good things
to do).

- -chris

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGbb5O9CaO5/Lv0PARAobjAKC9/4h/UAAHv4W4O19GRMjd8ywQEACdE+/e
EwOXUQ1ouqAHi3EA/2Sib+A=
=adMl
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: [OT] Thread Pool

Posted by Siraj Haider <si...@algomod.com>.
Thanks alot all for the help, yes it was my bad... I was not calling 
run() method instead of calling start{} method...

regards
-Siraj

Johnny Kewl wrote:
> Ha, well spotted... Chris
> Yes should look like this...             runner = new Thread(this);
>        runner.start();
> Yes, thats why connection is holding... is this group good or what ;)
>
> ----- Original Message ----- From: "Christopher Schultz" 
> <ch...@christopherschultz.net>
> To: "Tomcat Users List" <us...@tomcat.apache.org>
> Sent: Monday, June 11, 2007 11:27 PM
> Subject: Re: [OT] Thread Pool
>
>
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>>
>> Siraj,
>>
>> Siraj Haider wrote:
>>> Hello, Now I have changed my servlet.  I have created a new class 
>>> ResultFetcher extended by thread and now I am doing the checking 
>>> part inside that Thread.run() method.  and calling the new class 
>>> like this :
>>>
>>>       ResultFetcher rf = new ResultFetcher(something);
>>>       rf.setDaemon(true);
>>>       rf.run();
>>
>> Thread.run does not actually launch the new thread. It merely calls the
>> "run" method on it, synchronously. If you re-read the javadoc, you'll
>> see that Thread.start is what you really want to call.
>>
>> You can ignore the stabbing-in-the-dark advise that others are
>> attempting to give you... things like setting daemon status and closing
>> connections are unrelated to this problem (but actually very good things
>> to do).
>>
>> - -chris
>>
>> -----BEGIN PGP SIGNATURE-----
>> Version: GnuPG v1.4.7 (MingW32)
>> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>>
>> iD8DBQFGbb5O9CaO5/Lv0PARAobjAKC9/4h/UAAHv4W4O19GRMjd8ywQEACdE+/e
>> EwOXUQ1ouqAHi3EA/2Sib+A=
>> =adMl
>> -----END PGP SIGNATURE-----
>>
>> ---------------------------------------------------------------------
>> To start a new topic, e-mail: users@tomcat.apache.org
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>



This electronic mail message and any attachments may contain information which is privileged, sensitive and/or otherwise exempt from disclosure under applicable law. The information is intended only for the use of the individual or entity named as the addressee above. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution (electronic or otherwise) or forwarding of, or the taking of any action in reliance on, the contents of this transmission is strictly prohibited. If you have received this electronic transmission in error, please notify us by telephone, facsimile, or e-mail as noted above to arrange for the return of any electronic mail or attachments. Thank You.



---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: [OT] Thread Pool

Posted by Johnny Kewl <jo...@kewlstuff.co.za>.
Ha, well spotted... Chris
Yes should look like this...      
        runner = new Thread(this);
        runner.start();
Yes, thats why connection is holding... is this group good or what ;)

----- Original Message ----- 
From: "Christopher Schultz" <ch...@christopherschultz.net>
To: "Tomcat Users List" <us...@tomcat.apache.org>
Sent: Monday, June 11, 2007 11:27 PM
Subject: Re: [OT] Thread Pool


> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Siraj,
> 
> Siraj Haider wrote:
>> Hello, Now I have changed my servlet.  I have created a new class 
>> ResultFetcher extended by thread and now I am doing the checking part 
>> inside that Thread.run() method.  and calling the new class like this :
>> 
>>       ResultFetcher rf = new ResultFetcher(something);
>>       rf.setDaemon(true);
>>       rf.run();
> 
> Thread.run does not actually launch the new thread. It merely calls the
> "run" method on it, synchronously. If you re-read the javadoc, you'll
> see that Thread.start is what you really want to call.
> 
> You can ignore the stabbing-in-the-dark advise that others are
> attempting to give you... things like setting daemon status and closing
> connections are unrelated to this problem (but actually very good things
> to do).
> 
> - -chris
> 
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.7 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
> 
> iD8DBQFGbb5O9CaO5/Lv0PARAobjAKC9/4h/UAAHv4W4O19GRMjd8ywQEACdE+/e
> EwOXUQ1ouqAHi3EA/2Sib+A=
> =adMl
> -----END PGP SIGNATURE-----
> 
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
>

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org