Suspending and resuming thread pool
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Anonymous
Posted On:   Monday, August 25, 2003 08:54 AM

Hi , I would like to know the neat way to suspend resume a threadpool.This threadpool is implemeted in a standard way which creates worker threads stored as FIFO Queue. etc.Any link to sample code would be appreciated. I am using this pool in a class in which there are suspendPro and resumePro methods also which would change the flag suspend.I have also written suspend / resume method in worker thread class. My class which uses this pool operates in follwing logic: a method() { while(stop is not requested){ while(some logic){//loop pool.execute(Runnable );//creates threads } } if(stoprequested){ pool.stopa   More>>

Hi ,

I would like to know the neat way to suspend resume a threadpool.This threadpool is implemeted in a standard way
which creates worker threads stored as FIFO Queue. etc.Any
link to sample code would be appreciated.


I am using this pool in a class in which there are suspendPro and resumePro methods also which would
change the flag suspend.I have also written suspend / resume method in worker thread class.


My class which uses this pool operates in follwing logic:
			

a method() {
while(stop is not requested){
while(some logic){//loop
pool.execute(Runnable );//creates threads
}

}
if(stoprequested){
pool.stopallthreads();//kills all threads
}
//if out of logic
pool.stopallthreads();

}//end amethod

suspendPro {
suspend = true;
}
resumePro {
suspend = false;
}


   <<Less

Re: Suspending and resuming thread pool

Posted By:   David_Bates  
Posted On:   Thursday, September 11, 2003 06:46 AM

I don't think there is anything pre-built in the current version of Java to help you with this. However, we've been promised such libraries in JDK 1.5.
About | Sitemap | Contact