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] [October 2010 Threads] Task switchingPosted 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()?
/Casper
RE: Task switchingPosted 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 switchingPosted 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!
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|