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




Loading

Operation of RTOS

Posted by Nobody/Anonymous on April 28, 2006
I'm studing your rtos code for Atmel AVR.


But I've some question about priority and task execution time.


This is my problem :

suppose we have 3 task (A, B, C)


I want to be sure that each task is executed every 1 mSec independently from their time of elaboration.

But the important thing is that the scheduler must stops task A , task B or task C and start the other tasks independently from their work.

I explain : if task A (in reponse to an user input...a stupid example...an user has entered to calc the sqr from 1 to 25000000) needs about 10 mSec for his work, I want that the kernel stops task A and executes task B.

Same thing for the other task. Task B must be stopped (if not finished) after max 1 msec because another task needs starting


Is it possible with freertos ???


Another question:

In the article about context switching you write "TaskB has a higher priority than TaskA so vTaskSwitchContext() selects TaskB as the task to be given processing time when the ISR completes" (http://www.techonline.com/static/feature_articles/barry/step4.html)

But if I have only two task (A and B) in my program and the task B has low priority then task A, the context switch will never happens ???



Excuse me, but I'm a primer with rtos.

Thank you

Best regards

RE: Operation of RTOS

Posted by Richard on April 28, 2006
I'm not sure I follow your questions fully, but I think they are both referring to the scheduling policy.

FreeRTOS is a preemptive priority based kernel. A task will never execute if there is a task of higher priority that is ready to execute (not blocked). In other words, the scheduler will always choose to run the highest priority task that is able to run at the expense of any lower priority tasks.

If the preemptive scheduler is being used then task can be given the same priority. When there are more than one task of the same priority a context switch will occur each kernel tick. So I think the answer to your first question is that if each of the three tasks are given the same priority they will share the processing time, provided there are no tasks of higher priority that are able to run.

Regards.


[ 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