Quality RTOS & Embedded Software

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


Is uxTaskGetStackHighWaterMark() preemptible?

Posted by alessandro1963 on June 30, 2015

Hello everybody, I have a low-priority task that periodically checks the other tasks' stack usage by means of uxTaskGetStackHighWaterMark(). Is this function preemptible by the FreeRTOS scheduler? In other words, can the higher priority tasks run without having to wait for uxTaskGetStackHighWaterMark() to complete (causing a kind of priority inversion situation)? I checked the code and I didn't see any ENTERCRITICAL ... EXITCRITICAL sections, so I assume that uxTaskGetStackHighWaterMark() can be preempted by the scheduler, but I just want to make sure.

Thank you Alex

Is uxTaskGetStackHighWaterMark() preemptible?

Posted by rtel on June 30, 2015

I've just looked at the code and cannot see any reason why the functionality is not thread safe - so yes the functions can be pre-empted by higher priority tasks but that should not cause you a problem.


Is uxTaskGetStackHighWaterMark() preemptible?

Posted by alessandro1963 on June 30, 2015

Thank you very much for your quick reply.

Best Regards

[ Back to the top ]    [ About FreeRTOS ]    [ Sitemap ]    [ ]

Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.

Latest News

Meet us at Embedded World. Hall 3A-525.

Hear from Richard Barry at Embedded World. Feb 28, 16:00, Hall 4-428.

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

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

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