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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,a555752235c318a9 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!proxad.net!newsfeed.stueberl.de!npeer.de.kpn-eurorings.net!news.agarik.com!skynet.be!newspost001!tjb!not-for-mail Date: Thu, 02 Dec 2004 18:38:59 +0100 From: Adrien Plisson User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.2) Gecko/20040804 Netscape/7.2 (ax) X-Accept-Language: fr-fr, fr-be, fr, en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: i'm going crazy with task References: <1101830171.387036.135810@f14g2000cwb.googlegroups.com> <41ad991b$0$25066$ba620e4c@news.skynet.be> <5eorq0lbcd90apmjoe46ob4pj96pchtcno@4ax.com> <41adf355$0$13460$ba620e4c@news.skynet.be> <1101980654.258589.267930@f14g2000cwb.googlegroups.com> In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: <41af5253$0$25070$ba620e4c@news.skynet.be> Organization: -= Belgacom Usenet Service =- NNTP-Posting-Host: fc10dc20.news.skynet.be X-Trace: 1102008915 news.skynet.be 25070 217.136.248.104:4267 X-Complaints-To: usenet-abuse@skynet.be Xref: g2news1.google.com comp.lang.ada:6720 Date: 2004-12-02T18:38:59+01:00 List-Id: Dennis Lee Bieber wrote: > A fancier version would create a task for each entry; the core > of each task is just: > > delay until start_time > user_app_main() this is a bit overkill: if you have many jobs to run, you will start by creating that many tasks which will stay idling in the background until start_time. i know that a task does not (or should not) consume processing resources while idling, but they still uses memory resources and they certainly uses system resources (system objects as handles or such) which may be limited. a better approach would combine the priority list/queue of the first case with the task creation of the second: while queue.notEmpty loop pull job from queue delay until start_time create a task and pass it the user_app_main function end loop and the core of the task will just have to call the given function at startup and die when it has terminated. this way the tasks exists only when needed, thus limiting resource consumption. > Simulating what /I/ think of when I hear "task scheduler" is > going to be much more difficult. it's interresting to see that our interpretation depends on the level we see the problem. you see the task scheduler at the very low level of scheduling processes for pseudo-concurrent execution on a single processor. i see the task scheduler at the high level of deferred process execution. -- rien