I am writing a servlet/JSP which spawns three java threads and has to wait
for the 3 threads to finish processing before sending the results got from
the threads to the client browser.

Here a gist of what i do

---------------------------------------------------------------
doGet method

        create thread1
        create thread2
        create thread3

        start thread1
        start thread2
        start thread3

        wait for all threads to complete. This could be a while loop

        While(atleast one thread is running) sleep

        send output back as html.
---------------------------------------------------------------
I know this can be done in different ways using wait/notify and
yield/suspend/resume etc.

I would like to hear from you guys about the most efficient way to do it.

Appreciate your inputs
Sanjay

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html

Reply via email to