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


Task switching

Posted by Casper Hedegaard on October 6, 2010
Hi all.
I'm using FreeRTOS on an Atmel 32bit controller and want to switch quickly between a few tasks. As far as I can see, the taskYIELD() function only sets a task to be "ready", so if the task with the highest priority is calling taskYIELD(), it will take its turn again right away and not letting the other tasks have a go? Is there another function to call to let tasks with a lower priority have a go without using equal priorities, using vTaskDelay or changing priority and then use taskYIELD()?


RE: Task switching

Posted by Richard Damon on October 6, 2010
This sounds more like a program design issue, as you are excluding exactly the things to do what you want.

By the definition of Priority, a ready task of highest priority will be running. If your higher priority task to let a lower priority task run you need to ask is it really at the time a higher priority task? or is the issue that it really shouldn't be ready now? If it isn't the highest priority task, then some task needs it priority changed (either it or the other task that should be run now). If it really shouldn't be ready now, how do you determine when it will be ready again? If it is after a period of time, then it should delay, if it need information for something then it should wait on a queue or semaphore, that will be set when that data is available either by an interrupt or another task.

RE: Task switching

Posted by Casper Hedegaard on October 7, 2010
You are probably right. This isn't going to be a problem if the priorities are thought through. Thank you for your quick reply!

[ 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