Re: Java Component Scheduling




"killerCoder" <fahdshariff@xxxxxxxxx> wrote in message
news:1141040942.311942.298660@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
In my system I have a java component which I want to activate only
within a certain time window.

It is a distributed system consisting of a jobproducer which hands out
tasks to the workers. Each worker runs on a different host. I want a
worker to start up and process jobs only if the time is right.

I am currently thinking along the following lines:
- pass in a time-window argument to the worker program e.g. 1900-0600
(7pm to 6am)
- if the current time is valid, it registers with the job producer and
starts receiving/processing jobs
- if the current time is not valid, it sleeps for a bit and tries
again.
- after completing a job, it checks whether it can take on another job
at the current time. If it can't it sleeps.

I don't really like the idea of the sleeps. I also don't want the
producer to be burdened with the task of activating workers at certain
times. Is there a better way?

Does anyone have any experience of doing something like this? Any help
would be appreciated.

Have you given any thought to using cron to handle the scheduling? That's
how these things are usually done in the Unix world. There are versions of
cron that work on Windows too if you're worried about compatibility, plus
there is a scheduler in some versions of Windows.

--
Rhino


.



Relevant Pages

  • Problem with Storable on Windows
    ... Core 4), it doesn't seem to work on Windows, returning the following ... print "Caller starting\n"; ... print "Worker started\n"; ... then reading it on the worker using sysread and using thaw ...
    (comp.lang.perl.modules)
  • Modal Dialogs on worker threads can cause exceptions in MFC with N
    ... I have an MFC application that puts up several message boxes on worker ... This has always worked when compiled with MFC 6.0. ... on Windows 2000 and Windows XP. ...
    (microsoft.public.win32.programmer.ui)
  • Re: UI Thread : Wheres the processing?
    ... My reading of the documentation on worker and UI ... The message queue which is necessary for a UI thread is created on ... It is also important to note that windows and threads have a natural ... I hope that I have alleviated some confusion. ...
    (microsoft.public.vc.language)
  • Re: Interacting with Windows Service (but more than just status)
    ... I will be creating a tray Icon (Notify ... Icon) and a windows form to manage this service. ... any of the worker ... What I need to do is to get some information back to the Tray Icon app or ...
    (microsoft.public.dotnet.general)
  • Java Component Scheduling
    ... It is a distributed system consisting of a jobproducer which hands out ... Each worker runs on a different host. ... if the current time is valid, it registers with the job producer and ... If it can't it sleeps. ...
    (comp.lang.java.help)