Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Real time embedded FreeRTOS mailing list 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem TCP & FAT Training




Loading

vTaskDelete From xTaskGenericCreate

Posted by l4n4 on March 31, 2014

Since the current vTaskDelete is only called when the Idle Task is running, I encounter some cases when my system is too busy to let the idle task run & do the clean-up. Currently I'm trying not to create/delete tasks too many times, but still hoping to add a way to handle it when it happens. I'm considering to add another call to vTaskDelete from xTaskGenericCreate. In this way, when the idle task have a chance to run, it still going to delete the task waiting for termination. But when the idle task has no chance, the next task create will do the actual clean-up. Any thoughts on this? Thanks.


vTaskDelete From xTaskGenericCreate

Posted by rtel on March 31, 2014

You could define a trace macro to insert the code you want into the task create function as follows (insert at the bottom of FreeRTOSConfig.h):


#define traceTASK_CREATE( x ) while( uxTasksDeleted > 0 ) prvCheckTasksWaitingTermination()

Note that would only be called after memory was allocated for the task being created.

Regards.


vTaskDelete From xTaskGenericCreate

Posted by l4n4 on March 31, 2014

Ok. Any specific reason why the deletion should be done after the memory is allocated for the new task? Because if the system has a very limited memory, it might be useful to do clean-up before any allocation. Thanks again.


vTaskDelete From xTaskGenericCreate

Posted by rtel on March 31, 2014

It does not have to be - that is just where the trace macro I suggested defining is called from. Doing what you want using a trace macro just prevents you from having to edit the source files.

Regards.


vTaskDelete From xTaskGenericCreate

Posted by tlafleur on March 31, 2014

In general terms, limited memory system should build static task. Ie: never delete a task.

~~ _/) ~~~~ _/) ~~~~ _/) ~~~~ _/) ~~ Sent from my Phone

On Mar 30, 2014, at 8:37 PM, "Real Time Engineers ltd." rtel@users.sf.net wrote:

It does not have to be - that is just where the trace macro I suggested defining is called from. Doing what you want using a trace macro just prevents you from having to edit the source files.

Regards.

vTaskDelete From xTaskGenericCreate

Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/freertos/discussion/382005/

To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/

Attachments

alternate (1326 bytes)

vTaskDelete From xTaskGenericCreate

Posted by l4n4 on March 31, 2014

Got it. Thanks.


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




Copyright (C) 2004-2010 Richard Barry. Copyright (C) 2010-2016 Real Time Engineers Ltd.
Any and all data, files, source code, html content and documentation included in the FreeRTOSTM distribution or available on this site are the exclusive property of Real Time Engineers Ltd.. See the files license.txt (included in the distribution) and this copyright notice for more information. FreeRTOSTM and FreeRTOS.orgTM are trade marks of Real Time Engineers Ltd.

Latest News:

FreeRTOS V9.0.0 is now available for download.


Free TCP/IP and file system demos for the RTOS


Sponsored Links

⇓ Now With No Code Size Limit! ⇓
⇑ Free Download Without Registering ⇑


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Renesas Electronics Gold Alliance RTOS Partner.jpg

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Atmel RTOS partner supporting ARM Cortex-M3 and AVR32 microcontrollers

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

Xilinx Microblaze and Zynq partner

Silicon Labs low power RTOS partner

Altera RTOS partner for Nios II and Cortex-A9 SoC

Freescale Alliance RTOS Member supporting ARM and ColdFire microcontrollers

Infineon ARM Cortex-M microcontrollers

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

Cypress RTOS partner supporting ARM Cortex-M3

Fujitsu RTOS partner supporting ARM Cortex-M3 and FM3

Microsemi (previously Actel) RTOS partner supporting ARM Cortex-M3

Atollic Partner

IAR Partner

Keil ARM Partner

Embedded Artists