vsfat - threadsafe

Reiner1210
Posts: 39
Joined: Tue Mar 20, 2018 6:28 pm

vsfat - threadsafe

Postby Reiner1210 » Sun Apr 01, 2018 5:16 pm

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

ESP_igrr
Posts: 2072
Joined: Tue Dec 01, 2015 8:37 am

Re: vsfat - threadsafe

Postby ESP_igrr » Mon Apr 02, 2018 12:56 am

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.

Reiner1210
Posts: 39
Joined: Tue Mar 20, 2018 6:28 pm

Re: vsfat - threadsafe

Postby Reiner1210 » Mon Apr 02, 2018 10:27 pm

Thanks ! :-)

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

Who is online

Users browsing this forum: Majestic-12 [Bot] and 147 guests