How to make dictionary thread safe during async tasks that adds and read from the dictionary?
I got a case where I got like 10 async tasks running on their own threads, which retrieves files from a ftp server. What each process do with the dictionary is that it add the filename and last written size to the dictionary, and since all the process is reading and writing to the dictionary at the same time, I'm a bit afraid of exceptions such as Enumerable has been modified, which I got during working with List and async tasks processes.
How can I solve this problem?