Hi again,
I think you know that the servlet-engine launches a new thread for every
client-request.
You may send your email with this thread, then the client has to wait until
your email-send method returns.
An other possibility is to start an new thread for sending the email. So the
servlet returns faster but the user can't be told if its email was sent.
If you want to send lots of mail, then I think it could be senseful to
buffer the emails from the client and have a 'mail dispatch'-thread in your
app, which sends the buffered emails in regular intervals.
greets, peter
Von: Mukesh Garg <[EMAIL PROTECTED]>
An: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
Datum: Montag, 21. Februar 2000 08:28
Betreff: Multithreading in Servlets
Can anybody please help me how do i make use of Threading in Servlets
My problem is
My servlets is being made to handle thousands of request to send a mail.
I have implemented an SMTPClient class that sends mail for every
request.
Now what I want is I launch a new thread for every request for sending
mail
so that servlets serves each client at the same time
What would be the best approach for this
and what are the issues which need to be take care of to make it Thread
safe.
Thanx and Regards
Mueksh garg
___________________________________________________________________________
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