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] [April 2017 Threads] taskYIELD and task slot length optimizationPosted by alsaleem on April 10, 2017 I have several tasks of same priority. Each time slot is 10msec (ticks is 100Hz).
If a task needs only 6msec (of 10msec). I would like to give rest of time to other tasks instead of waiting next tick (assuming no active high priority task take over on next tick).
As per the maual, taskYIELD will cause OS to switch to other tasks. The next task will only have 4msec of work before next context switch because of SysTick.
Assuming above is correct,
(1) Is there a way to make OS not to context switch on next tick?
(2) If a high priority task wants to allow lower priority tasks to do some work until next tick, will vTaskDelayUntil(&var, 1) block running task immediately and allow lower priority tasks do work until next tick?
Thanks.
taskYIELD and task slot length optimizationPosted by richard_damon on April 10, 2017 1) If you disable Time Slicing then tasks of the same priority will not rotate on ticks, but only when yeilding or blocking.
2) If you have Preemption enabled, then the higher priority task will startup as soon as it is ready (which if it is doing a delay, will be on the timer tick).
One note, if you really want to delay till the next timer tick, use vTaskDelay(1), vTaskDelayUntil(&var, 1) will only delay if the task has 'caught up' to the tick counter.
taskYIELD and task slot length optimizationPosted by alsaleem on April 10, 2017 for (1) I am working on preemption. Assuming no higher priority tasks.
So, will taskYIELD allow next (same priority) task to run until next tick or for whole time slice?
Thanks.
taskYIELD and task slot length optimizationPosted by rtel on April 10, 2017
taskYIELD and task slot length optimizationPosted by alsaleem on April 11, 2017 thanks. that is short and clear answer.
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|