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

Discussion in 'Java' started by neo, Oct 23, 2003.

  1. neo

    neo Guest

    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 ????
     
    neo, Oct 23, 2003
    #1
    1. Advertising

  2. neo

    Roedy Green Guest

    On 22 Oct 2003 23:26:41 -0700, (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.
     
    Roedy Green, Oct 23, 2003
    #2
    1. Advertising

  3. neo

    bm Guest

    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" <> wrote in message
    news:...
    > 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 ????
     
    bm, Oct 23, 2003
    #3
  4. neo

    A Dahlman Guest

    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/Programs.html#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
     
    A Dahlman, Oct 27, 2003
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Codemonkey
    Replies:
    8
    Views:
    9,620
  2. Andy Ogden

    Too many client tasks

    Andy Ogden, Jul 1, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    1,757
    Andy Ogden
    Jul 1, 2003
  3. Franz
    Replies:
    0
    Views:
    3,170
    Franz
    Apr 6, 2004
  4. =?Utf-8?B?QnJ1Y2U=?=

    Task Scheduler GUI doe not allow new tasks to be added

    =?Utf-8?B?QnJ1Y2U=?=, Jul 13, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    408
    =?Utf-8?B?QnJ1Y2U=?=
    Jul 13, 2006
  5. pozz
    Replies:
    27
    Views:
    786
    Seebs
    Mar 4, 2011
Loading...

Share This Page