Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem


Loading

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) Amazon Web Services, Inc. or its affiliates. All rights reserved.

Latest News

FreeRTOS kernel V10.0.1 is available for immediate download. Now MIT licensed.

Video: Watch James Gosling & Richard Barry at re:Invent, Las Vegas 2017.

New FAQ page about the FreeRTOS kernel and Amazon FreeRTOS.


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

OpenRTOS and SafeRTOS

Xilinx Microblaze and Zynq partner