From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,2ead6cfaad7d134b,start X-Google-Attributes: gid103376,public From: ebert@muc.de (Rolf Ebert) Subject: scheduler program in Ada Date: 1998/06/05 Message-ID: <6l97ru$l9@colin.muc.de>#1/1 X-Deja-AN: 359880903 Organization: MUC.DE - Individual Network (IN) Domain Munich Newsgroups: comp.lang.ada Date: 1998-06-05T00:00:00+00:00 List-Id: I'd like to write a scheduler in Ada much like the Unix crond program. The program has a cycle time of 5 minutes, for example. A config file specifies jobs which have to be started at a given offset from the start of the cycle. That is I have a list of (offset,job) pairs. The possible offsets have a resolution of 1/10 sec. Theoretically we could start 5*60*10=3000 jobs per 5min. cycle. What is the best approach to do that in Ada? I have thought about two possible solutions: 1) One task starts a new task every 1/10 sec. The newly created task looks into the (offset,jobs) - list and decides if anything is to do. If it is , it starts the corresponding job. Either the task terminates after finishing the job or it stops if there is nothing to do. 2) As the list of (offset,job)-pairs does not change over time, the scheduler can calculate the starting times once for all. It can than avoid starting unneccessary tasks . Not having too much experience with the tasking facilities of Ada, is there anything else I can do? Rolf ebert@wapor.muc.de ebert@muc.de ebert@pe-muc.de