Scheduling question

Hi, First of all, you did a great job with FreeRTOS. I have a question about priorities. For example, if i’m running 3 tasks (T1, T2, T3). The priority of T1= 2 and the priority for T2 = 1 and T3 = 1. Can you explain me how the scheduler will execute the code in time ? Does T1 will execute 2 times or will execute longer ? T1 -> T2 -> T1 -> T3 or T1 -> T1 -> T2 -> T3 or … I Hope my example is clear. Thank you for your help !!

Scheduling question

Assuming you are using the preemptive scheduler: T1 is the highest priority task.  Any time T1 is not blocked it will execute. T2 and T3 have the same priority, but a priority less than T1.  T2 and T3 will only execute if T1 is blocked.  When T1 is blocked T2 and T3 will take it in turns to execute. Regards.

Scheduling question

the higher priority task takes cpu time until it needs it,after releasing execution other tasks can be runned!

Scheduling question

Richard, What do you mean by "blocked" Thanks

Scheduling question

? Unable to run. If it calls vTaskDelay(), vTaskDelayUntil() then it will block until the correct time to unblock. If it calls xQueueReceive() it can specify a block time.  A time it wants to wait for data if data is not already available.

Scheduling question

Is it possible that a task can’t block ?

Scheduling question

A task will block if you tell it to.  If you don’t, it wont. A task can also exist in a ready state – in this case it is ready to run (not blocked) but not running because a task of higher or equal priority is running. I think maybe you could do with some background reading.  Start with www.freertos.org/implementation.

Scheduling question

The idle task cannot block – at least your stuffed if it does.  You should know these things before using FreeRTOS.  Are you a student?

Scheduling question

ok that much is understood. But now the question is: If 2 or more processes are running ( each of same priority), how much time does each process get?? Is it in a Round Robin fashion? If so it has to split the Tick interrupt timing, right? I understood it as that at each Tick the scheduler check for higher prioroty task. So do the tasks here run for one whole tick??  Where is this code specified (file name,line no.)?? Thank you.

Scheduling question

Previous posting by me itself. ok that much is understood. But now the question is: If 2 or more processes are running ( each of same priority), how much time does each process get?? Is it in a Round Robin fashion? If so it has to split the Tick interrupt timing, right? I understood it as that at each Tick the scheduler check for higher prioroty task. So do the tasks here run for one whole tick?? Where is this code specified (file name,line no.)?? Thank you. Roy

Scheduling question

Yes there is round robin amonst tasks of the same priority. Read the documentation. Read the source code.