Maybe do a sleep instead of busy waiting (looping takes up too much cpu
time).
Kyle Wayne Kelly
(504)391-3985
http://www.cs.uno.edu/~kkelly
----- Original Message -----
From: "Michael Wentzel" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, August 06, 2001 4:10 AM
Subject: RE: Servllet
> > How about running an application that periodically posts to
> > the servlet?
> >
> >
> > > How can a servlet be automatically be invoked by
> > > itself, say peroidically?
> > > Usul
>
> I think a better way is to write a servlet which is configured
> as a load on startup servlet which forks a separate "scheduler"
> thread which then defines tasks to be completed at specified
> interval(using a properties file or init params...). The
> Thread(Runnable) will essentially be a infinite loop which will
> check to see if it's time to run certain tasks. i.e.
>
> while(1) {
> if ( /*somethings true 1*/ ) {
> /*perform task 1*/
> }
> if ( /*somethings true 2*/ ) {
> /*perform task 2*/
> }
> // ...
> }
>
>
> ---
> Michael Wentzel
> Software Developer
> Software As We Think - http://www.aswethink.com