Metro App FileIO.WriteTextAsync Multiple Threads
问题 I have a method which is called frequently from multiple threads. It involves writing to disk using await FileIO.WriteTextAsync . This works fine when it is called from a single thread, but once I start doing this in multiple threads, I get this error: The process cannot access the file because it is being used by another process. I know what the error means, but I'm not sure how to work around it. Normally, I would create a lock(object) statement, to ensure that the file is being accessed by