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=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!news.unit0.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Niklas Holsti Newsgroups: comp.lang.ada Subject: Re: How to get Ada to ?cross the chasm?? Date: Wed, 9 May 2018 01:26:13 +0300 Organization: Tidorum Ltd Message-ID: References: <1c73f159-eae4-4ae7-a348-03964b007197@googlegroups.com> <87in88m43h.fsf@nightsong.com> <87efiuope8.fsf@nightsong.com> <87lgd1heva.fsf@nightsong.com> <87zi1gz3kl.fsf@nightsong.com> <878t8x7k1j.fsf@nightsong.com> <87k1sg2qux.fsf@nightsong.com> <87h8njmk4r.fsf@nightsong.com> <87po27fbv9.fsf@nightsong.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net 7tAwcP0vWAr5/NliOB4SyAO26wTXTGoAjqqU6rpwshUqUYL1tI Cancel-Lock: sha1:owW97HcRWb3W7TuNc4LcefWTcWY= User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 In-Reply-To: <87po27fbv9.fsf@nightsong.com> Xref: reader02.eternal-september.org comp.lang.ada:52139 Date: 2018-05-09T01:26:13+03:00 List-Id: On 18-05-07 23:29 , Paul Rubin wrote: > "Dmitry A. Kazakov" writes: ... >>> So you still get arbitrarily long pauses. >> No, because I know the structures I deal with and can avoid that >> choosing proper design. > > In other words you are manually managing memory, which is what > refcounting is supposed to get you out of. No, Dmitry just knows (by design of the data structure) that there are no long/deep chains of references needing to be updated. >> Millisecond is very long for many applications, > > In such a system you better not use a refcount scheme either, without a > WCET analysis. Some kind of WCET analysis is very often needed in real-time systems whatever kind of memory management is used. This is another of the ways in which such systems differ from the typical applications of GC-based languages. However, there is a functional programming language, Hume, designed for real-time systems, https://en.wikipedia.org/wiki/Hume_(programming_language). > I'd add as well: most refcount systems I know of don't move objects > around in memory, so you get memory fragmentation and high cache miss > rates. Real-time systems with reference counting often use special "heaps" or "pools" with block sizes designed to fit the application and to avoid or minimize fragmentation. Caches are often small, and main memories not very large either, so the penalty for cache misses is often less than in larger server-like systems. For example, in my current project a RAM access needs only 2 wait states, and we in fact run with the D-cache disabled (this reminds me that we should experiment to see if the program is faster or slower with the D-cache enabled...) The most critical task in this application has a 500 Hz frequency and is budgeted at something like 0.5 - 0.8 ms per activation. The application uses reference counting for some data structures, but the 500 Hz task is designed not to use it directly; a lower-frequency support task supplies and receives the reference-counted data to and from the 500 Hz task. Just as an example. I think Dmitry often deals with shorter times and higher task frequencies. But then his stuff is ground-based and runs on more powerful processors. -- Niklas Holsti Tidorum Ltd niklas holsti tidorum fi . @ .