comp.lang.ada
 help / color / mirror / Atom feed
From: Jacob Sparre Andersen <sparre@nbi.dk>
Subject: Re: Task with access to itself?
Date: Tue, 11 Dec 2012 12:21:06 +0100
Date: 2012-12-11T12:21:06+01:00	[thread overview]
Message-ID: <87ehiwygv1.fsf@adaheads.sparre-andersen.dk> (raw)
In-Reply-To: k9nuct$f4n$1@dont-email.me

Jeffrey Carter wrote:

> We make extensive use of a similar pattern, but rather than having the
> tasks register their availability and be given work to do, we have the
> tasks get their work from a protected queue. The task body tends to
> look like
>
> Forever : loop
>    exit Forever when Finalization.Control.Finalizing; -- Protected function
>
>    select
>       Work_Queue.Get (Item => Work_Item);
>       -- Blocks until something is on the queue
>       Process (Job_Info => Work_Item);
>    or
>       delay ...;
>    end select;
> end loop Forever;

This is a nice pattern, but it lacks two features I would like to have:

 1) Dynamic addition of tasks.
 2) Control over which order the worker tasks are activated in.

Point 2 can of course be managed with an appropriate
modification/addition to the run-time system.

Greetings,

Jacob
-- 
"The current state of knowledge can be summarised thus:
 In the beginning, there was nothing, which exploded."



  reply	other threads:[~2012-12-13  8:14 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-05 13:53 Task with access to itself? Jacob Sparre Andersen
2012-12-05 14:18 ` Dmitry A. Kazakov
2012-12-05 16:57 ` Jeffrey Carter
2012-12-11 11:21   ` Jacob Sparre Andersen [this message]
2012-12-11 20:39     ` Jeffrey Carter
2012-12-12 20:25       ` Jacob Sparre Andersen
2012-12-12 21:11         ` Jeffrey Carter
2012-12-13  7:20           ` Jacob Sparre Andersen
2012-12-06  9:38 ` Egil Høvik
2012-12-06 19:53   ` Adam Beneschan
replies disabled

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