You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems that this implementation do not guarantee multi-thread safety?
Since in struct FileSystem, the disk field is wrapped by RefCell which would panic if two thread call borrow_mut() (considering multi-core scenario).
By the way, if fatfs do not guarantee multi-thread safety, I think it at least should not panic, but keep related data dirty.
The text was updated successfully, but these errors were encountered:
AFAIK FileSystem is not Send so you can't share it between threads . To use it in a multi-threaded application you have to wrap it in a Mutex. Therefore there is no risk of borrow_mut panicking.
If I'm wrong please provide an example where it could panic.
We tried to use rust-fatfs for our own operating system in non-std scenario.
A mutex for the whole file system could work, but every fs operation is serialized.
It seems that this implementation do not guarantee multi-thread safety?
Since in
struct FileSystem
, thedisk
field is wrapped byRefCell
which would panic if two thread callborrow_mut()
(considering multi-core scenario).By the way, if fatfs do not guarantee multi-thread safety, I think it at least should not panic, but keep related data dirty.
The text was updated successfully, but these errors were encountered: