# Communication between task and Co-Routine

**URL:** <https://forums.freertos.org/t/communication-between-task-and-co-routine/5535>\
**Category:** Kernel\
**Created:** [June 12, 2007, 11:01am UTC](https://forums.freertos.org/t/communication-between-task-and-co-routine/5535 "2007-06-12T11:01:13Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [June 12, 2007, 11:01am UTC](https://forums.freertos.org/t/communication-between-task-and-co-routine/5535/1 "2007-06-12T11:01:13Z")

</div>

**[m\_brormann](https://sourceforge.net/u/m_brormann/)** wrote on [Tuesday, June 12, 2007](https://sourceforge.net/p/freertos/discussion/382005/thread/f44f74ee/#d8b7):

Hi,  
i use in my project tasks and Co-Routines. Is it possible to communicate between a task and a Co-Routine with a queue?

Example Code:

Co-Routine:  
…  
extern xQueueHandle xQueue;  
…  
crQUEUE\_SEND( xHandle, xQueue, &xNumberToPost, NO\_DELAY, &xResult );  
…

Task:  
xQueueHandle xQueue;  
…  
xQueue = xQueueCreate( 10, sizeof( struct AMessage \* ) );  
if( xQueue == 0 )  
{  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Failed to create the queue.  
}  
…  
xQueueReceive( xQueue, &( pxRxedMessage ), ( portTickType ) MAX\_DELAY);  
…

I want that the task blocks until the co-routine sends a message.

regards  
markus
