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] [January 2017 Threads] Relation between task priority and the scheduling interval Posted by eswdev14 on January 11, 2017 Hi all,
I'am relatively a beginner with using FreeRTOS.
I have a general, but important question about FreeRTOS and its scheduling interval.
In what way is there a relation between the assigned task priority and its corresponding task schedule interval
used by the FreeRTOS scheduler? Is there something to say about for example taskX has a priority of 4 and the corresponding scheduling task interval is say 3ms?
Any help in guiding me I will appreciate!
Thanks,
Max
Relation between task priority and the scheduling interval Posted by hs2sf on January 11, 2017 prio and time slice / quantum are different things. There is no direct relationship in the sense you describe. Which higher level problem do you want to solve ?
For example a periodic task can be setup by using a timer or just a timeout and choosing a prio matching your runtime system requirements.
Relation between task priority and the scheduling interval Posted by richard_damon on January 12, 2017 FreeRTOS has a fixed ftask scheduling interval of 1 Tick, i.e. every tick the current running task is put at the end of the ready queue for its execution priority and the next task with the same priority (which might be the task just running) is then run. Since the class of machine that FreeRTOS runs on do not normally use virtual memory, there is little need to have lower priority tasks have a larger execution quantum.
Relation between task priority and the scheduling interval Posted by eswdev14 on January 12, 2017 Thanks for the answer! But if I understand it correctly, can I use several hardware timers of the ARM microcontroller to have periodic tasks with FreeRTOS? If no, how can I configure/tailor FreeRTOS to have several periodic tasks which would be scheduled in say 2, 3 and 5ms in my microcontroller application? And how about configuring the SysTick timer used by the FreeRTOS scheduler? An example would be very helpful!
Relation between task priority and the scheduling interval Posted by rtel on January 12, 2017 Hi Max - have a look here:
http://www.freertos.org/Documentation/RTOS_book.html
Relation between task priority and the scheduling interval Posted by hs2sf on January 12, 2017 Well, the most simple (hence often the best) approach could be to configure the SysTick period less or equal to your minimum period because Systick is the minimum resolution of timers resp. timeouts and use a dedicated task per rate.
The periodic tasks are merely simple loops waiting for it's timeout to expire, doing housekeeping and wait again... The tasks can be prioritized accordingly and you're fine ;)
Sure - there a number of alternative approaches, but probably with the price of increasing complexity e.g using hardware timers with ISRs usually signalling events to task context, etc. On the other hand using dedicated peridiodic tasks costs a bit more RAM needed for the task stacks..
Relation between task priority and the scheduling interval Posted by simonjwright on January 12, 2017 You only get round-robin scheduling if configUSE_TIME_SLICING is 1.
Relation between task priority and the scheduling interval Posted by rtel on January 12, 2017 Depends how you defined round robin scheduling. configUSETIMESLCICING
prevents a context switch between tasks of equal priority just because
of a tick interrupt - but tasks of equal priority will still take turns
to execute.
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|