How to have synchronous writing to a file (Threads) ?
- by bobby
Hi all.
I created and started some Threads that each one writes something to a common text file.
but the following error appears to me:
"The process cannot access the file 'C:\hello.txt' because it is being used by another process."
void AccessFile()
{
int num = 5;
Thread[] trds = new Thread[5];
for (int i = 0; i…