This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
Hi everyone, Here is my code after I click place order.
//step 1, pre-process an order order.PreProcess();//this step takes 1 second. //step 2, send order to ERP; order.SendToErp;//this step takes 15 seconds. //step 3, display JSP CallJsp();//this step takes 2 seconds. As you can see, after I click the submit button, it will take me around 20 seconds to display the next page. My question is: how to move step 2 into the background, so, step 3 don't need to wait the return of step 2. thanks, Michael [ November 20, 2002: Message edited by: Michael Deng ]
Michael, Multi-threading is far too complicated to be explained in a discussion group post. You should find a good article or book that introduces threading and read that. Basically, you create a subclass of Thread (or a class that implements Runnable, which you pass into a Thread's constructor), and then call start(). Java Threads by Scott Oaks and Henry Wong (O'Reilly) is pretty good.