Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem


Loading

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.


[ Back to the top ]    [ About FreeRTOS ]    [ Sitemap ]    [ ]




Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.

Latest News

FreeRTOS kernel V10.0.1 is available for immediate download. Now MIT licensed.


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

OpenRTOS and SafeRTOS