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.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: "G.B." Newsgroups: comp.lang.ada Subject: Re: Getting the index for an element in mutually referencing containers Date: Sun, 12 Mar 2017 10:38:28 +0100 Organization: A noiseless patient Spider Message-ID: References: <86o9xa36oq.fsf@gaheris.avalon.lan> <86k27xpikd.fsf@gaheris.avalon.lan> <86wpbxneuz.fsf@gaheris.avalon.lan> Reply-To: nonlegitur@notmyhomepage.de Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Sun, 12 Mar 2017 09:35:39 -0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="3174e6b7dd49751763d6cad9339d6aad"; logging-data="12611"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18XD8i+r4lhwvoN4sWElUY6cMM5Y0kj8z0=" User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:45.0) Gecko/20100101 Thunderbird/45.7.1 In-Reply-To: Cancel-Lock: sha1:DOjWWnSC7nlLOVfGmw0s7sUWFVY= Xref: news.eternal-september.org comp.lang.ada:27851 Date: 2017-03-12T10:38:28+01:00 List-Id: On 12.03.17 09:22, Simon Wright wrote: > Niklas Holsti writes: > >> On 17-03-11 23:46 , Simon Wright wrote: >> >>> Basically, I (Simon, now) am having trouble thinking of an >>> application where reference counting would be an appropriate >>> solution. >> >> How about this one: the SW generates messages (telemetry packets) >> reporting various sorts of data and events. >> > [...] >> >> Each destination has a queue of incoming messages, and the queueing >> and processing time for a given message varies accordingly. Rather >> than copy the (possibly long) message into each destination's queue, >> the queues hold references to a single, shared instance of the >> message, dynamically allocated in a memory pool. These references are >> counted. When, finally, all destinations have processed the message, >> the message's reference count reaches zero, and the message can be >> deallocated. >> >> This use of reference counting is a typical design in satellite >> on-board SW. > > Thanks for the example! A good one that should have a place in Ada Docs on Stackoverflow, I think. > I still have a feeling that this is an in-computer software technique > which resolves a software problem, rather than a necessary response to > an application-domain problem. The radio operators, log inspectors, or message-monitoring staff might feel overlooked after being changed into a software problem! ;-)