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

Difference between blocked and suspended

Posted by Riccardo Manfrin on May 21, 2013
Hi,
I would like to resume this post

https://sourceforge.net/projects/freertos/forums/forum/382005/topic/1742153

I'm not familiar with Freertos (complete ignorant newbie), but I do not comprehend the need to differentiate between suspended and blocked states for a task.

If the difference is really just about the presence of a timeout for blocked state, then in my mind, I see a timeout just like any other type of event that is going to release a semaphore for the sake of a suspended routine. It can be a keyboard press, a timeout, or the union of these and several more events.

Therefore, I'd like to know the motivation for supporting these two states. They are reported in documentation and differentiated in APIs, therefore I assume there must be some good reason that I'm missing for them to exist.

Maybe timeout support from the OS ensures RTOSness responsivity, or maybe it guarantees 100% that something will wake up the task, which maybe is not so sure to happen if I had that timeout handled by the carefree hands of a userspace task.. ? Or maybe I'm completely misunderstanding everything at all.

I'd like to understand this aspect of FreeRTOS.

Thanks,
RM

RE: Difference between blocked and suspended

Posted by Westmoreland Engineering on May 21, 2013
Hello RM,

I haven't looked at the previous thread - but I will try to explain to you so this makes sense:

Think of vTaskSuspend ( NULL ); and vTaskResume ( xTaskHandle); as task control mechanisms. When the task is suspended vTaskSuspend ( NULL or xTaskHandle ) has been called.

When a task is waiting on an event - such as a semaphore being available or data from a Queue - and it waits - then it is blocking on that event. Think of this as task synchronization.

So you have two discrete things to think about regarding tasks - control and synchronization. Note these are simple examples but I am trying to get you to think about what you need to do with your tasks.

If you are new to the RTOS world - and it sounds like you are - it will take a little while to get your head around all of this. An RTOS will help you to distribute system resources in an equitable fashion, in either hard or soft real-time. You really need to understand what hard and soft real-time mean. I am sure you can find a lot of explanations of this on the internet.

The best way to learn is by doing - so the more you program and use the RTOS, the more you will learn. By the time you are done, you will understand the differences between blocked and suspended states; filling or waiting on queues, and giving and taking semaphores.

Hope This Helps,
John W.


[ 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