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 ]    [ Privacy ]    [ Sitemap ]    [ ]

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

Latest News

NXP tweet showing LPC5500 (ARMv8-M Cortex-M33) running FreeRTOS.

Version 10.1.1 of the FreeRTOS kernel is available for immediate download. MIT licensed.

View a recording of the "OTA Update Security and Reliability" webinar, presented by TI and AWS.


FreeRTOS and other embedded software careers at AWS.

FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Espressif ESP32

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

Xilinx Microblaze and Zynq partner