Return-Path: Delivered-To: apmail-cocoon-dev-archive@www.apache.org Received: (qmail 9552 invoked from network); 1 Sep 2003 16:12:28 -0000 Received: from daedalus.apache.org (HELO apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 1 Sep 2003 16:12:28 -0000 Received: (qmail 35063 invoked by uid 500); 1 Sep 2003 16:12:14 -0000 Delivered-To: apmail-cocoon-dev-archive@cocoon.apache.org Received: (qmail 35042 invoked by uid 500); 1 Sep 2003 16:12:14 -0000 Mailing-List: contact dev-help@cocoon.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Reply-To: dev@cocoon.apache.org Delivered-To: mailing list dev@cocoon.apache.org Received: (qmail 35022 invoked from network); 1 Sep 2003 16:12:13 -0000 Received: from unknown (HELO lapgp.otego.com) (195.216.81.146) by daedalus.apache.org with SMTP; 1 Sep 2003 16:12:13 -0000 Received: (qmail 25135 invoked from network); 1 Sep 2003 16:12:10 -0000 Received: from localhost (127.0.0.1) by localhost with SMTP; 1 Sep 2003 16:12:10 -0000 Date: Mon, 1 Sep 2003 18:12:09 +0200 (CEST) From: Giacomo Pati Sender: giacomo@lapgp.otego.com To: dev@cocoon.apache.org Subject: RE: CommandManager issues [was Re: Releasing 2.1.1?] In-Reply-To: <1E0CC447E59C974CA5C7160D2A2854EC097D0B@SJMEMXMB04.stjude.sjcrh.local> Message-ID: References: <1E0CC447E59C974CA5C7160D2A2854EC097D0B@SJMEMXMB04.stjude.sjcrh.local> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N On Mon, 1 Sep 2003, Hunsberger, Peter wrote: > Giacomo Pati writes: > > > > > First, if you look at the Cornerstone Scheduler you'll see > > that the ability to define repeated tasks are somehow > > limited. Business apps can easily request administration > > tasks to be run twice a day on work days. To define this with > > the Cornerstone Scheduler you'll need to add 10 'cron' > > entries to it. This is why I'd like to extend it using the > > unix cron direction to define ranges and list of timing > > aspects. But then you're faced with the problem of defining > > sleep time for efficient use (which you need to be able to > > cooperate in the Cornerstone Scheduler machinery). > > > > The unix cron daemon runs every minute to check if there are > > any jobs to run. It checks initially creating bitsets for the > > minute, hour, day, month, and weekday definition for each > > task. This makes it easy to check whether a task has to be > > launched. I still haven't found an algorithm (and I think > > there isn't an easy one available) to determine the sleep > > time until the next task is due. > > I did this once upon a time, I think in C code. As I recall it's > basically the equivalent of building a Map of tasks and the calculated > delta time until they need to be executed next and then using the > minimum of these deltas. I don't think it's all that complex? This > could be a little problematic if the delta's are in the same order of > magnitude as the time to calculate them :-), but that certainly doesn't > seem to be the case here.... Where is that code, dude :-) -- Giacomo Pati Otego AG, Switzerland - http://www.otego.com Orixo, the XML business alliance - http://www.orixo.com