Is asynchronous file IO like FileStream.BeginWrite thread safe? If not, then it need to wrap with "SyncLock", that's mean it is still blocking thread.
FileStream.BeginWrite already starts a new thread to access the files. You don't need to start the FileStream.BeginWrite on a separate thread (because that will be thread in a thread). On the other hand, multiple FileStream.BeginWrite functions should not be accessing the same file at the same time.
Also if the resource is accessed by multiple threads, it means it is a shared resource and there are plentiful of resources about using them in c#.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With