FreeRTOS Support Archive
The FreeRTOS support forum is used to obtain active support directly from Real
Time Engineers Ltd. In return for using our top quality software and services for
free, we request you play fair and do your bit to help others too! Sign up
to receive notifications of new support topics then help where you can.
This is a read only archive of threads posted to the FreeRTOS support forum.
The archive is updated every week, so will not always contain the very latest posts.
Use these archive pages to search previous posts. Use the Live FreeRTOS Forum
link to reply to a post, or start a new support thread.
[FreeRTOS Home] [Live FreeRTOS Forum] [FAQ] [Archive Top] [April 2010 Threads] Passing a pointer, how to know when done?Posted by Juha Kuusama on April 28, 2010 Hi,
I want to pass relatively large block of data from many tasks task to one. It doesn't make sense to pass the data itself, but a pointer to it. Using the queue is obvious for passing the pointer, as several tasks can write to one queue. What would you consider a good method of signaling the sender that the receiving task is done with the data? Thank you for your insight!
Cheers,
Juha
RE: Passing a pointer, how to know when done?Posted by Richard on April 28, 2010 This is really an application decision. I think there are lots of ways it could be done.
For example, it could be the receiving task that frees the memory so the sending task does not have to do anything. This is only a suitable solution if the memory is dynamically allocation and memory fragmentation is not an issue.
Alternatively the receiving task could somehow mark the memory (write to the first byte, clear the memory, set a different variable, etc.) once it is finished with it.
There are other options too, the receiver could signal the sender using a queue or semaphore, etc. The best option depends on your application.
Regards.
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|