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

How to taskYIELD() a specific task ?

Posted by Nobody/Anonymous on April 10, 2006

Is there any function similar to taskYIELD() that allow for scheduling a precise task ?

I am running multiple tasks, one beeing for polling the serial port and another beeing for sending data on it. I am having a serial_busy boolean flag that mention if some operation is going on already, to avoid messing with the serial port interruptions. However, testing that flag does not allow me to give the hand back to the task that is supposed to have the control (I can only taskYIELD(), which will often give back control to the current task).

Any suggestion ?

Thanks

-jfv (jfv@cesar.org.br)

RE: How to taskYIELD() a specific task ?

Posted by Nobody/Anonymous on April 11, 2006
Not sure I follow your logic here. It sounds like you want to change the prioritisation of your tasks to achieve what you want. Maybe you want to dynamically change the priorities to force one task to execute over another?

RE: How to taskYIELD() a specific task ?

Posted by Nobody/Anonymous on April 11, 2006

That is what Im doing right now, but it still does not acheive what I wanna do.

I have 2 threads TS and TR, respectively for sending and receiving data from the serial port. Moreover I have a flag that tells if the serial port is used at the moment, so that if the sending task or the receiving task loses hands in the middle of an operation, I am not messing with multiple interruptions on the serial port at a time (that leads to exceptions generally).

If my flag 'serial_busy' test flag is true and the serial_send task is running, then I have to switch to the serial_recv task, and the other way, if this flag is true and I am into the serial_recv task, then I need to switch to the serial_send task so that I dont lose too much cycles doing something irrelevant, instead of directly go to the task that needs to be executed.

It could simply be done having a taskYIELD() function which takes a parameter beeing the task handle that needs to be scheduled, unfortunately there is no such function in FreeRTOS (or I did not find it after looking a lot at the source code). I could do it using some assembly code but I dont know if this would implies big behavioral changes of the scheduler.

Anyone else has a suggestion on how to resolve this ?

Thanks

-jfv <jfv@cesar.org.br>

RE: How to taskYIELD() a specific task ?

Posted by Jeff Smith on April 11, 2006
Well everything about the task manager is to determine which task runs next, but maybe look into semaphores (or queues). The idea is that when one task tries to take a semaphore, it simply waits until another task which is running gives the semaphore. Hence, one runs first, then tells the other to start running.


[ 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