C# multi-threaded write file problem

So I encountered a problem: for example I have 5 threads if you also write files that have different names, is certainly no problem, but if there are 2 name may be wrong, that file is being accessed. How do I realize: thread A is writing a file of the same name, another B thread JOIN wait, while the other will not write a file of the same name of CDEF does not influence, still write their own, the A thread B thread after judgment documents have not writing to perform the logic behind. 

You say LOCK, if I LOCK this file to write code, the CDEF had to wait, multi thread is meaningless. I was in a file with the same name to LOCK? Or my idea is not normal? More To share 

In Run 3 you will run. A lot.

Started by Felipe Lynch at February 12, 2019 - 12:58 AM