From mboxrd@z Thu Jan 1 00:00:00 1970 References: From: Philippe Gerum Subject: Re: EVL Heap Clarification Date: Wed, 15 Jun 2022 08:35:56 +0200 In-reply-to: Message-ID: <87o7yupdlo.fsf@xenomai.org> MIME-Version: 1.0 Content-Type: text/plain List-Id: Discussions about the Xenomai project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Russell Johnson Cc: xenomai@xenomai.org Russell Johnson via Xenomai writes: > Am I correct in assuming that any dynamic allocation in an EVL thread needs > to use the EVL heap in order to avoid in-band context switching? > > > > There are 4 calls in particular that I am using from the EVL heap API: > evl_init_heap (on startup), evl_alloc_block (may be called during realtime > processing to expand a data structure), evl_free_block (on shutdown), > evl_destroy_heap (on shutdown). The question is are all 4 of these calls > expected to only ever be called by an EVL thread? Looking at the source > code, I see that the alloc and free functions lock/unlock an EVL mutex so I > assume those can only be called from an EVL thread? Though the error codes > are not checked on those mutex calls, so if you call alloc or free from a > Linux thread, they do not fail. Can init and destroy be called from a Linux > thread? I was looking at the test code in libevl for heap-torture, and it > appeared that all 4 of these functions were being called from an EVL > attached thread. > Please check this documentation, the 3rd column gives the answer: https://evlproject.org/core/user-api/function_index/#memory-heap-services -- Philippe.