comp.lang.ada
 help / color / mirror / Atom feed
From: Adrien Plisson <aplisson-news@stochastique.net>
Subject: Re: i'm going crazy with task
Date: Thu, 02 Dec 2004 18:38:59 +0100
Date: 2004-12-02T18:38:59+01:00	[thread overview]
Message-ID: <41af5253$0$25070$ba620e4c@news.skynet.be> (raw)
In-Reply-To: <gmduq0hd1l97714g219custsomfo9b8an6@4ax.com>

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



      parent reply	other threads:[~2004-12-02 17:38 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-11-30 15:56 i'm going crazy with task mferracini
2004-11-30 16:11 ` mferracini
2004-11-30 16:33   ` Alex R. Mosteo
     [not found] ` <lglqq0lvgvdbr0gbjhqhit27omga2cm7r5@4ax.com>
2004-12-01 10:16   ` Adrien Plisson
     [not found]     ` <5eorq0lbcd90apmjoe46ob4pj96pchtcno@4ax.com>
2004-12-01 16:41       ` Adrien Plisson
2004-12-02  9:44         ` mferracini
     [not found]           ` <gmduq0hd1l97714g219custsomfo9b8an6@4ax.com>
2004-12-02 17:38             ` Adrien Plisson [this message]
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox