This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Threads and Synchronization and the fly likes Need help regarding scheduler program Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Threads and Synchronization
Bookmark "Need help regarding scheduler program" Watch "Need help regarding scheduler program" New topic
Author

Need help regarding scheduler program

Keerthi Kumar
Ranch Hand

Joined: Apr 20, 2009
Posts: 105
Dear All,

I am new to thread programming. I have a requirement, where I need to crawl data from different repositories as per the scheduled date and time. So, when there is a scenario that one job starts executing and keeps continuing for more than the expected time and a new job has to be executed with the same time, what needs to be done.

a. because, the first job would be still running.
b. also the second job has to starts is execution as per the schedule.
c. also, the requirement is even if the first job is still executing after the given time, the second job has to start his execution.

Request to please help me out in the above scenarios


Cheers,
Keerthi Kumar N
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18546
    
  40

Keerthi Kumar wrote:Dear All,

I am new to thread programming. I have a requirement, where I need to crawl data from different repositories as per the scheduled date and time. So, when there is a scenario that one job starts executing and keeps continuing for more than the expected time and a new job has to be executed with the same time, what needs to be done.

a. because, the first job would be still running.
b. also the second job has to starts is execution as per the schedule.
c. also, the requirement is even if the first job is still executing after the given time, the second job has to start his execution.

Request to please help me out in the above scenarios


The built in Java job scheduller -- java.util.concurrent.ScheduledThreadPoolExecutor -- uses a thread pool, so two jobs can be running concurrently.

Henry


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Need help regarding scheduler program
 
Similar Threads
Why my program works fine when i write Thread.sleep(0)
http client + thread save conn manager + execute get request time problems
Condition Variable await method
what could be the answer ...
static members initialization and static object references