This week's giveaways are in the MongoDB and Jobs Discussion forums.
We're giving away four copies of Mongo DB Applied Patterns and 4 resume reviews from Five Year Itch and have the authors/reps on-line!
See this thread and this one 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
Register / Login


Win a copy of Mongo DB Applied Patterns this week in the MongoDB forum
or a resume review from Five Year Itch in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Threads and Synchronization
Reply 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: 16680
    
  19

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)
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Need help regarding scheduler program
 
Similar Threads
what could be the answer ...
static members initialization and static object references
Why my program works fine when i write Thread.sleep(0)
Condition Variable await method
http client + thread save conn manager + execute get request time problems