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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,92a027c293f03acb X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news1.google.com!news.glorb.com!news-in.ntli.net!newsrout1-win.ntli.net!ntli.net!news.highwinds-media.com!xara.net!gxn.net!194.159.246.34.MISMATCH!peer-uk.news.demon.net!kibo.news.demon.net!news.demon.co.uk!demon!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: Workqueues in Ada Date: Sat, 28 Jul 2007 20:53:26 +0100 Organization: Pushface Message-ID: References: <4rvzewqs9ba3$.pluy1xzoi5lr$.dlg@40tude.net> NNTP-Posting-Host: pogner.demon.co.uk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: news.demon.co.uk 1185652406 8032 62.49.19.209 (28 Jul 2007 19:53:26 GMT) X-Complaints-To: abuse@demon.net NNTP-Posting-Date: Sat, 28 Jul 2007 19:53:26 +0000 (UTC) Cancel-Lock: sha1:eOS+nqWIEdEGtZb4WkWcNdQQuKY= User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (darwin) Xref: g2news2.google.com comp.lang.ada:1243 Date: 2007-07-28T20:53:26+01:00 List-Id: Wiktor Moskwa writes: > My idea of using a circular list is to call Delete and Append only > when new node joins the system or an old one leaves. During normal > operations a task will request new unit of work without deleting it > from the queue. It will be only marked as "currently in use". Other > tasks will skip this node - Next_To_Service pointer will move > clockwise skipping nodes that are serviced at the moment. Sounds very complicated & fragile to me, it no longer resembles anything one would recognise as a 'queue'. Would it help to have a queue of pointer-to-work-item? (depends on how big a work-item is, because (I have a strong impression that) Ada.Containers containers allocate/deallocate on Append/Delete). It's hard to see how to avoid this with unbounded containers. You could look at alternative container packages? (I normally wouldn't suggest this, given Ada.Containers, but a BC.Comtainers.Queues.Bounded from http://booch95.sf.net doesn't allocate .. but you have to know the maximum number of elements you are going to need.)