* EVL Heap Clarification
@ 2022-06-14 22:39 Russell Johnson
2022-06-15 6:35 ` Philippe Gerum
0 siblings, 1 reply; 2+ messages in thread
From: Russell Johnson @ 2022-06-14 22:39 UTC (permalink / raw)
To: Xenomai@xenomai.org
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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 6759 bytes
Desc: not available
URL: <http://xenomai.org/pipermail/xenomai/attachments/20220614/849fd3ec/attachment.bin>
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: EVL Heap Clarification
2022-06-14 22:39 EVL Heap Clarification Russell Johnson
@ 2022-06-15 6:35 ` Philippe Gerum
0 siblings, 0 replies; 2+ messages in thread
From: Philippe Gerum @ 2022-06-15 6:35 UTC (permalink / raw)
To: Russell Johnson; +Cc: xenomai
Russell Johnson via Xenomai <xenomai@xenomai.org> 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.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-06-15 6:35 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-06-14 22:39 EVL Heap Clarification Russell Johnson
2022-06-15 6:35 ` Philippe Gerum
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.