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


some questions on co-routine

Posted by choren lin on August 6, 2008
My version is v4.2.1,
1. What are the differences between a co-routine and a task?
What is the meaning that a co-routine really is?
I know an app can include several tasks or several co-routines, or the mixture. But how to decide that when to use a co-routine rather than a task?

2. Is it right that a task can not be access to a queue created by a co-routine? Or, a co-routine can not be access to a queue created by a task.
I think that it is right because there is not a serial of routines to implement it in FreeRTOS. Beside, if a task can be

access to a co-routine queue. It is possible that the co-routine queue will suspends the task, if that happens, then how to
order the event list in the queue? The result is that the queue can not order the task from co-routines, because the priority of the task is essentially different from that of a co-routine.
Is my understanding right?

3. Does a co-routine 'that run by the idle_task_hook' use the stack of idle task?
I think it does. Because a co-routine can be treated as a part of idle task, and it just is a normal subroutine in the body of idle task.

4. A high priority task interrupts the running co-routine, then the task finishes and the idle task gets the CPU again. Will

the idle task run at the interrupted point within the co-routine? And will the registers resume?
I think it will. Because co-routine is just a part of idle task.

5. Will the content resume , when a co-routine previously suspened itself but now it is running again?
I think the content can not resume, and the registers maybe change. Because the implement of a co-routine suspending itself is different from that of a task, a co-routine suspends itself just exit from a 'for(;;)' loop. When the co-routine is entered again, it will start to run from the top, not the suspended point.
Is that above right?

Expecting for your answer!

[ 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