I’m uring StreamReader to read/write from/to a file in two threads, read in one and write in other. I want that these two don’t occur at the same time. What lock should I use? I looked at some examples but they were using FileStream.Lock and I’m not sure whether I can use that with StreamReader so please clarify.
I’m uring StreamReader to read/write from/to a file in two threads, read in one
Share
You could create your own lock: