Re: fetch loop
Re: fetch loop
- Subject: Re: fetch loop
- From: Kieran Kelleher <email@hidden>
- Date: Wed, 26 Apr 2006 14:00:31 -0400
Philippe,
If you can understand Chinese, you will have no problem understanding threads ;-)
The guys on Software Engineering Radio have just started a series of podcasts on concurrency. http://se-radio.net/
Seriously though, sooner or later, you need to have separate threads doing work independently of the Request-Response loop (WO's "built-in" WorkerThreads). If you have long running tasks, you need a separate thread to run while using something like a WOLongResponsePage to keep the user posted on the status of the long process.
For beginning to understand threads, look at chapter 15, Networking and Threads of Head First Java.... and just google for a few intro articles and learn about synchronized, deadlock, Runnable, Callable and ExecutorService, manage your editing contexts properly in the threads, use backport-util-concurrent and you'll be multi-threading in no time!
Regards, Kieran On Apr 26, 2006, at 11:56 AM, Philippe Lafoucrière wrote:
On 25 avr. 06, at 12:55, Kieran Kelleher wrote: Also, when I said the "DA can run the code", I really mean the "DA should spawn off your CheckRemoteTask into a separate thread" in case your checking code is longer than the allowable 30 seconds for R-R loop. This is really easy if your just use use an ExecutorService to run your CheckRemoteTask (since TimerTask is Runnable already)
ExecutorService is part of java 1.5, BUT we can use the java 1.5 java.util.concurrent in java 1.4 by simply getting the bacport from here:
Thank you for your suggestion, this sounds like chinese today for me, I have to read some doc now :)
Philippe
|
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden