in reply to Scheduling internal functions/processes to run within a program (like cron does programs)
I see two possible ways of approaching this :
First, you use fork(), and spawn off all the periodic children as children who sleep(). This is easy, as long as you don't need elaborate communication between your children.
The other method would be to implement your own version of cooperative multitasking. I've done something like that in Push HTTP Server, but before you embark on anything like this, have a look at POE, which also does this. Before you choose to go down that way, note that you can't allow any long operations unless you can stomach your whole server being non-respondant. This also means that you could want to look a bit at asynchronous IO, as far as your OS supports it (and Perl).
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Scheduling internal functions/processes to run within a program (like cron does programs)
by BMaximus (Chaplain) on May 23, 2001 at 15:06 UTC | |
by blue_cowdawg (Monsignor) on May 23, 2001 at 17:50 UTC |