Page 1 of 1

vsfat - threadsafe

Posted: Sun Apr 01, 2018 5:16 pm
by Reiner1210
Hello,

is the SD access (via SPI) and the vsfatfs threadsafe ? So can I open / read / write on file from on thread and ano ther file from an other thread ?
IN lwip there are the functions with _r for being threadsafe.

Reiner

Re: vsfat - threadsafe

Posted: Mon Apr 02, 2018 12:56 am
by ESP_igrr
Yes, you should be able to use open/read/write files from multiple threads. Be aware though that FatFS library does not allow certain kinds of operations to be done in parallel on the same file. For example, you will get an error if you open a file in one thread and try to rename the same file in another thread. Working with different files should work though.

Re: vsfat - threadsafe

Posted: Mon Apr 02, 2018 10:27 pm
by Reiner1210
Thanks ! :-)

I have build a web server on ESP32 and downloading files will be done in different tasks for each file