Path: csiph.com!feeder.erje.net!2.eu.feeder.erje.net!news-2.dfn.de!news.dfn.de!news.informatik.hu-berlin.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Sylvia Else Newsgroups: sci.electronics.design Subject: Re: Paper on dynamic memory allocation for real-time systems Date: Tue, 24 Oct 2017 19:49:58 +1100 Lines: 32 Message-ID: References: <%D4GB.50140$6V2.21096@fx21.iad> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net /xXUwAxyxS/zEQnkOXIVrwgS+5fvTwzPk61TvMyY2nTcBOV0jT Cancel-Lock: sha1:t93iWM4IL6Vv0Ptul/N7d5Z82Bk= User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 In-Reply-To: <%D4GB.50140$6V2.21096@fx21.iad> Content-Language: en-US Xref: csiph.com sci.electronics.design:482637 On 20/10/2017 3:44 AM, bitrex wrote: > "Dynamic memory allocation has been used for decades. However, it has > seldom been used in real-time systems since the worst case of spatial > and temporal requirements for allocation and deallocation operations is > either unbounded or bounded but with a very large bound. > > In this paper, a new allocator called TLSF (Two Level Segregated Fit) is > presented. TLSF is designed and implemented to accommodate real-time > constraints. The proposed allocator exhibits time-bounded behaviour, > O(1), and maintains a very good execution time. This paper describes in > detail the data structures and functions provided by TLSF. We also > compare TLSF with a representative set of allocators > regarding their temporal cost and fragmentation." > > Even so, if I'm designing a real-time system, I can either allocate all the memory I'm going to need, either "dynamically" during initialization, or statically. Then I don't have to concern my self with trying to figure out whether the worst case execution time or worst case fragmentation may break my program. Indeed, I don't have to determine what my worst case memory requirement is. I may then be creating something that needs more physical memory than might otherwise have been enough, but memory isn't that expensive. I suppose there may be real-time systems out there where failure IS an option, but they'd be few and far between. Sylvia.