Thanks for this reply. Could you explain what is meant by a "locking scheme"?
Sure:
In my code I open the Filestream once and keep it open. It would be a bad thing if multiple threads interacted with the the stream at "the same time". I therefore create an object to lock it (private object LockMe = new object() and any time I am reading or writing to the filestream I make sure the code holds a lock on this object (lock(LockMe) { //Code here } )
This way, you can ensure only one thread is interacting with the filestream at any given time. Just make sure the scope of LockMe is shared between all threads.
I hope this helps. You can google "C# lock()" for more reference.