winfsp / cgofuse

Cross-platform FUSE library for Go - Works on Windows, macOS, Linux, FreeBSD, NetBSD, OpenBSD
https://winfsp.dev
MIT License
514 stars 82 forks source link

Add information about thread-safety to the README/docs? #26

Closed joscarsson closed 4 years ago

joscarsson commented 5 years ago

Thanks for a great library!

Perhaps it is obvious for others, but I was wondering about thread-safety and the different callback methods. Is it on the implementor of the FileSystemInterface to protect data structures, or is it done by the library? In the Passthrough example, nothing is protected while in Memfs all methods are protected behind a single Mutex. Is it because the thread-safety is guaranteed by the underlying filesystem in the Passthrough case?

Would be nice to have some mention of this in the README/godoc reference.

billziss-gh commented 5 years ago

FUSE file systems are expected to protect their own data structures, unless the -s switch is passed which instructs the FUSE layer to serialize requests. This is true of cgofuse as well.

I will add this to the documentation.

joscarsson commented 5 years ago

Thanks!

billziss-gh commented 4 years ago

Finally added this to the documentation: 6b4bd137607ec423738e89f860118447083a5352

Sorry for the long delay.