----- Original Message -----
From: "Rahul Asanikar" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: 2002. m�rcius 6. 14:41
Subject: Re: Change timeout in runtime?


> just create a new thread in the dopost, and keep sending as many mails as
> you want in the run method. If you declare the thread object as member
> variable of the servlet, it will last even after dopost is finished.
> I hope it helps!

1. Started threads become global (or "root" using GC terminology) objects
from the GC standpoint, so it's not necessary to reference a running thread
from _anywhere_ in order for it not to terminate ("last" as you'd say it).
It'd be funny if GC called Thread.stop() on threads that became
"unreachable" from other threads :-) ...

2. The async processing is fine, but the guy will need a separate facility
for querying the progress and result of the task since the response will
follow immediately. Also, this still won't prevent the session from expiring
which can also be an issue.

3. If that's indeed a spammer application (it looks very much as one), I
wish it all the worst.

--
Attila Szegedi
home: http://www.szegedi.org


>
> ----- Original Message -----
> From: B Public <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Thursday, March 07, 2002 3:52 AM
> Subject: Change timeout in runtime?
>
>
> Hello.
> my first post to this list :))
>
> I'm about to write a servlet that for one request is suppose to run
> for several hours (it's suppose to generate and send about 260 000
> mail).
>
> Is it possible for me to change timeout on the servlet when it
> realizes that it's not gonna make it in time? in runtime i mean.
> i.e.
>
> if (it's 2 minutes until timeout and i have 200 000 mails to go) {
> set timeout = 1 hour ahead;
> }
>
> OR
>
> Is it a better way to do what i describe? i wanna avoid setting
> timeout to 24 hours just to be sure...
>
> all help and suggestions is welcome!
> Best Regards
> --
> Bj�rn Alexandersson, [EMAIL PROTECTED] on 03-06-2002
>
>
___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the
body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>
>
___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the
body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>
>
>
>

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to