# FreeRTOS+FAT thread safety

**URL:** <https://forums.freertos.org/t/freertos-fat-thread-safety/20689>\
**Category:** Libraries\
**Created:** [June 12, 2024, 10:09am UTC](https://forums.freertos.org/t/freertos-fat-thread-safety/20689 "2024-06-12T10:09:13Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![carlk3](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/carlk3/32/266_2.png) [@carlk3](https://forums.freertos.org/u/carlk3)\
**Post date:** [June 12, 2024, 6:21pm UTC](https://forums.freertos.org/t/freertos-fat-thread-safety/20689/2 "2024-06-12T18:21:27Z")

</div>

I can’t help you with your first two questions, but I’ve been using it in heavily multi-threaded applications for a long time. If you compare it to [FatFs](http://elm-chan.org/fsw/ff/00index_e.html), for example, FatFs has some support for “re-entrancy” or thread safety, but it does not appear to have sufficient FAT and directory locking in FatFs to make operations like `f_mkdir`, `f_chdir` and `f_getcwd` thread safe, whereas FreeRTOS+FAT does.

Take a look at [ff\_locking.c](https://github.com/FreeRTOS/Lab-Project-FreeRTOS-FAT/blob/main/ff_locking.c) and [vMultiTaskStdioWithCWDTest](https://github.com/carlk3/FreeRTOS-FAT-CLI-for-RPi-Pico/blob/a363bb3f87abff77642a160602f748c3582bae49/examples/command_line/tests/ff_stdio_tests_with_cwd.c#L1163C6-L1163C32) in [ff\_stdio\_tests\_with\_cwd.c](https://www.freertos.org/FreeRTOS-Plus/FreeRTOS_Plus_FAT/basic_stdio_API_tests.html).

Also, see [Announcement: FreeRTOS Symmetric Multiprocessing (SMP) +FAT running on Raspberry Pi Pico](https://forums.freertos.org/t/announcement-freertos-symmetric-multiprocessing-smp-fat-running-on-raspberry-pi-pico/13440) for an example.

---

_[View the full topic](https://forums.freertos.org/t/freertos-fat-thread-safety/20689)._
