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

Theoretical doubts

Posted by joseph23 on June 19, 2016

Hello everyone, before I start, im sorry if im posting in the wonrg area of the forum, im new and i didnt understand very well how it works.

I have 2 questions:In freertos there are 3 ways of avoiding resources sharing : interruption suspend, tasks suspend or using mutex semaphores. Where should i use each one of them?

other question is: What is Gatekeeper in the freertos and what is the advantage using it for resource management?

Thanks a lot, and im sorry if i posted in the wrong area


Theoretical doubts

Posted by rtel on June 19, 2016

This sounds like a school question?

taskENTERCRITICAL()/taskEXITCRITICAL():

These disable interrupts, normally up to a maximum user defined priority level rather than globally. As they disable interrupts they are only good for very short critical sections. They are however also very fast, so have minimum impact on interrupt responsiveness when used correctly (for very short sections). They also protect against both tasks and interrupts accessing a resource.

vTaskSuspendAll()/xTaskResumeAll():

These leave interrupts enabled, so can be used on longer critical sections, but should still be used sparingly as they will prevent a context switch. Suspending the scheduler is very fast, resuming it again is not deterministic though as one or more tasks that was unblocked while the scheduler was suspended will need to be processed when it is resumed, as do any tick interrupts that occurred while the scheduler was suspended.

Mutexes:

These have traditional OS mutex behaviour. The best method to use if mutually exclusive access is required for a relatively long period, such as when using a peripheral.

I'm sure there is a lot more that could be added.


Theoretical doubts

Posted by joseph23 on June 19, 2016

Thanks, it's not a school question, but there is a project in my school that i needed to learn something about this quickly.


[ 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