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

details in xTaskResumeFromISR

Posted by Yuhui Lin on July 27, 2010
In the implementation of xTaskResumeFromISR, it checks the state of scheduler. If the scheduler is not locked, it will change suspended list and ready list directly, otherwise only put the task, which is to be resume, in xPendingReadyList.

I don't understand what's the main concern for the state of scheduler, since this operation should be called from ISR.

RE: details in xTaskResumeFromISR

Posted by Richard Damon on July 27, 2010
There are some point in the kernel which manipulate the scheduler state, which rather than disable interrupts for an extended period of time, will just disable the scheduler. If the interrupt routine attempted to change the state of a task, this could cause a corruption of the scheduler, so the need to move the task to the ready list is noted and handled after the original operation is completed.

RE: details in xTaskResumeFromISR

Posted by Yuhui Lin on July 27, 2010
Thanks richard!

I've got another question. Following is one comment in funciotn xTaskIsTaskSuspended:
/* Is it in the suspended list because it is in the
Suspended state? It is possible to be in the suspended
list because it is blocked on a task with no timeout
specified.
*/

This scenario sounds reasonable. My question is what's the entry function for this scenario? I searched for xSuspendedTaskList in task.c file. I can't find relevent operations which may results in a blocked task stay in suspended queue. As the global varible xSuspendedTaskList is static, functions outside task.c file would not access it.

RE: details in xTaskResumeFromISR

Posted by Richard Damon on July 27, 2010
With a quick check of the source code, the function vTaskPlaceOnEventList check for indefinite timeouts and places these tasks on the suspended task list instead of the delayed task list. (so the task isn't automatically awakened after a period of time). Thus any call to a blocking function with a timeout delay of portMAX_DELAY that does block, will put the task on the xSuspendedTaskList (and will be removed when the block ends).


[ 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