Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > How do i implement a scheduler in java for many tasks(>1000) ?

Reply
Thread Tools

How do i implement a scheduler in java for many tasks(>1000) ?

 
 
neo
Guest
Posts: n/a
 
      10-23-2003
Hi ,
I am trying to write a scheduler in java for a huge number of tasks.
The Timer class says it does not like big resouce intensive tasks as
it would load its thread and lead to bunching of the later scheduled
ones.

Which is the best way to implement this scheduler in java and keep it
very accurate and scalable ????
 
Reply With Quote
 
 
 
 
Roedy Green
Guest
Posts: n/a
 
      10-23-2003
On 22 Oct 2003 23:26:41 -0700, http://www.velocityreviews.com/forums/(E-Mail Removed) (neo) wrote or
quoted :

>Which is the best way to implement this scheduler in java and keep it
>very accurate and scalable ????


you could use the Timer, but when the task was something nasty, spawn
a yet another thread.

--
Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming.
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
 
Reply With Quote
 
 
 
 
bm
Guest
Posts: n/a
 
      10-23-2003
Scheduled tasks are simply future events with time stamps
e1, e2, .., en where this list of time stamps are partially ordered,
that is e1 <= e2 <= .. <= en.

So you can create a Vector of these events and have only
one Timer. When the Timer goes off all events with that
time stamp in the queue are fired.

You may think if say there are n events with the same time stamp
there would be some time difference, say few mili-seconds perhaps,
between firing the event 1 and event n. But the same would be true
with n Timers. As timers are fired in sequence by the OS not all at
once.


"neo" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) om...
> Hi ,
> I am trying to write a scheduler in java for a huge number of tasks.
> The Timer class says it does not like big resouce intensive tasks as
> it would load its thread and lead to bunching of the later scheduled
> ones.
>
> Which is the best way to implement this scheduler in java and keep it
> very accurate and scalable ????



 
Reply With Quote
 
A Dahlman
Guest
Posts: n/a
 
      10-27-2003
neo wrote:
>
> Hi ,
> I am trying to write a scheduler in java for a huge number of tasks.
> The Timer class says it does not like big resouce intensive tasks as
> it would load its thread and lead to bunching of the later scheduled
> ones.
>
> Which is the best way to implement this scheduler in java and keep it
> very accurate and scalable ????


Nice to hear from you, Neo...

If by "scheduler" you mean to start some tasks at time A, others at time B,
and so forth, you have the answer from Roedy and "bm".

OTOH if you need some tasks to wait for others to complete--however long it
may take--then take a look at:

http://pws.prserv.net/ad/programs/Pr...#TaskScheduler

It shows how to assign each task to a thread and define "rules" for when each
task may start. Yes, could use lots of memory, but maybe less than you
expect. However, it does appear to be fully scalable.

Hope this helps. Tony Dahlman
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Dotnet scheduler like the Windows "Schedued Tasks" scheduler? Codemonkey ASP .Net 8 06-10-2011 10:53 AM
any open source java scheduler which support external clock dennis han Java 0 12-03-2010 03:17 PM
open source calendar, scheduler and/or organizer java component Jimmy Java 0 08-12-2008 03:04 PM
Why does java.rmi.Naming not implement interface java.rmi.Registry? Jan Schulze Java 1 03-26-2005 07:45 AM
Windows 2000, scheduler and java Christina Robertson Java 2 09-12-2003 12:22 PM



Advertisments