开发者

Can one task allocate memory from heap to be freed by some other task (say T2)?

开发者 https://www.devze.com 2022-12-28 20:19 出处:网络
I am new to VxWorks. I have a doubt regarding the memory allocation/deallocation in VxWorks: Can one task allocate memory from the开发者_如何学Python heap(say T1) and that can be freed by some other

I am new to VxWorks. I have a doubt regarding the memory allocation/deallocation in VxWorks:

Can one task allocate memory from the开发者_如何学Python heap(say T1) and that can be freed by some other task (say T2)?


If both tasks are executing in the same memory context, then yes it is totally possible.

If your tasks are executing in the kernel context (or you are using vxWorks 5.x) then there is no problem with what you are describing.

If both tasks are executing in the same RTP (Real-Time Process), the you can release the memory from T2.

What you can't do is release memory in different memory contexts i.e. release kernel memory from an RTP, or have RTP 2 release memory allocated by RTP1.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号