Hi, The code in the blog contains some visibility issues. So I wouldn't use that code in your application without making it Thread safe.
Since the write and read of the uploading and uploadComplete flag happen in different Threads access to those variables must be either protected by a lock or you can declare those attributes volatile. Otherwise the JMM gives no garantuee what so ever about changes made to those variables in one Thread can be seen in another Thread. So before you use the code either declare the uploading and uploadComplete flag as volatile or make the isXXX and setXXX methods synchronized. Cheers, Lars On Thu, Apr 24, 2008 at 4:52 AM, PhilipJohnson <[EMAIL PROTECTED]> wrote: > > Thanks everyone for all the great tips! > > The last hint on using a background thread led me to the following post by > Julian Sinai, who seemed to realize exactly what code example I would want > to look at, four days before I knew it myself! > > < > http://javathoughts.capesugarbird.com/2008/04/spawning-thread-for-lengthy-operation.html > > > > Thanks, Julian! > > Cheers, > Philip > -- > View this message in context: > http://www.nabble.com/Request-for-hints%3A-Long-duration-requests--ajax-%27status%27-line-tp16830536p16837476.html > Sent from the Wicket - User mailing list archive at Nabble.com. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >
