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,92a027c293f03acb X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!postnews.google.com!r34g2000hsd.googlegroups.com!not-for-mail From: Matthew Heaney Newsgroups: comp.lang.ada Subject: Re: Workqueues in Ada Date: Mon, 30 Jul 2007 08:48:49 -0700 Organization: http://groups.google.com Message-ID: <1185810529.671047.103500@r34g2000hsd.googlegroups.com> References: NNTP-Posting-Host: 66.162.65.129 Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-Trace: posting.google.com 1185810532 13507 127.0.0.1 (30 Jul 2007 15:48:52 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Mon, 30 Jul 2007 15:48:52 +0000 (UTC) In-Reply-To: User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.5) Gecko/20070713 Firefox/2.0.0.5,gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: r34g2000hsd.googlegroups.com; posting-host=66.162.65.129; posting-account=ps2QrAMAAAA6_jCuRt2JEIpn5Otqf_w0 Xref: g2news2.google.com comp.lang.ada:1266 Date: 2007-07-30T08:48:49-07:00 List-Id: On Jul 28, 1:00 pm, Wiktor Moskwa wrote: > > The problem is that my poor implementation of workqueue is a > bottleneck. A task takes a unit of work from a queue, processes it > and puts it back at the and of the queue. Because the queue is > Ada.Containers.Doubly_Linked_Lists there are lots of memory > allocations and deallocations - that's a performance problem. You can work around that using the Splice operations, which move nodes from one list container to another. You could use one list as a kind of free-store, from where you get new nodes. Instead of Deleting a node from a list, splice it onto the free-store list; this eliminates deallocation.