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


Scheduling Doubts

Posted by Roy on March 12, 2006
ok that much is understood abt scheduling what is given in the forum "scheduling question" and source code. The comments in the source code are very helpful.
But now the question is: If 2 or more processes are running ( each of same priority), how much time does each process get?? It is in a Round Robin fashion. So it has to split the Tick interrupt timing and giv a time slice to each task, 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.)?? Pls verify this doubt.
Thank you.

RE: Scheduling Doubts

Posted by Nobody/Anonymous on March 13, 2006

RE: Scheduling Doubts

Posted by Jörg Krein on March 13, 2006
in preemptive mode FreeRTOS always runs the highest available task until it blocks.
So if you got a high priority task wich does not call TaskDelay() or the like in regular, it might happen that lower priority tasks starve.
I wonder if its possible to guarantee lower priority tasks to get called from time to time even when there is a higher one active.
I wonder how other OSs handle this (Linux) and if its
feasible for low RAM low MIPS controllers.


RE: Scheduling Doubts

Posted by Nobody/Anonymous on March 13, 2006
This is how all systems of this type work. You decide which tasks should run by choosing their priority. If you want a low priority task to run even when a high priority task is able to run then you have your priorities set incorrectly.

RE: Scheduling Doubts

Posted by Nobody/Anonymous on March 13, 2006
You could have the high priority task temporarily raise the priority of the low priority task dynamically.

RE: Scheduling Doubts

Posted by Eddie on March 14, 2006
Ok now this,

We are using the lwip demo for arm7.

In the vBasicwebserver task (highest priority) it calls for vTaskDelay(webSHORTdelay).

So after this the lowertasks (led blinks) get processor time.

But if we comment the vTaskDelay(webSHORTdelay) line. the leds still get processor time.

How is this working?

RE: Scheduling Doubts

Posted by Nobody/Anonymous on March 14, 2006
it must block elsewhere in the task also.

RE: Scheduling Doubts

Posted by Eddie on March 14, 2006
Well I've been trough the code and am prety sure
that it doesn't get blocked. At least not in
place where I would expect it.

But isn't it true that, if the source of the task reaches a point that ther is nothing to be done at that point while(1); it gives the processor to the idle taks. or the task to be scheduled from the que?

It is definitely true that the task with the higest priority takes the processor and won't give it up even when it stuck in a while(1);

RE: Scheduling Doubts

Posted by Nobody/Anonymous on March 14, 2006
Taking a quick look I see vBasicWebServer calls netconn_accept which calls sys_mbox_fetch which blocks.

[ 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