✅ Thread-safe list
I'm trying to turn a piece of code which just calls a list of tasks asynchronous. Each of these tasks writes to a
List<T>
passed to all the tasks. I'm using Task.WhenAll
to run all the tasks in parallel, however I'm unsure of whether using a regular List<T>
is fine or if I should be using something else.2 Replies