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=-0.6 required=5.0 tests=BAYES_00,DATE_IN_PAST_24_48 autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,1d4203bfa2644439 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.180.19.194 with SMTP id h2mr5087513wie.0.1355386497864; Thu, 13 Dec 2012 00:14:57 -0800 (PST) Path: l12ni77940wiv.1!nntp.google.com!feeder3.cambriumusenet.nl!feed.tweaknews.nl!209.197.12.242.MISMATCH!nx01.iad01.newshosting.com!newshosting.com!newspump.sol.net!xlned.com!feeder3.xlned.com!news.astraweb.com!border6.a.newsrouter.astraweb.com!border4.nntp.ams.giganews.com!border2.nntp.ams.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!news.snarked.org!nntp.develooper.com!news.jacob-sparre.dk!munin.jacob-sparre.dk!pnx.dk!.POSTED!not-for-mail From: Jacob Sparre Andersen Newsgroups: comp.lang.ada Subject: Re: Task with access to itself? Date: Tue, 11 Dec 2012 12:21:06 +0100 Organization: Jacob Sparre Andersen Research & Innovation Message-ID: <87ehiwygv1.fsf@adaheads.sparre-andersen.dk> References: <8738zk7gge.fsf@adaheads.sparre-andersen.dk> NNTP-Posting-Host: monowall.adaheads.com Mime-Version: 1.0 X-Trace: munin.nbi.dk 1355224867 23046 77.234.168.91 (11 Dec 2012 11:21:07 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Tue, 11 Dec 2012 11:21:07 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) Cancel-Lock: sha1:ibVHNQrxV6XcQnTbHQhqz/+PaR0= Content-Type: text/plain; charset=us-ascii Date: 2012-12-11T12:21:06+01:00 List-Id: 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."