Parallel list
I'm trying to write to a list in parallel due to vendor SDK performance issues with sequential operations. I have the following code. Is this a proper approach?
3 Replies
Task.WhenAll is fine yeah(btw unless I'm blind
TransformRecordsParallel
is never called in your code)there is also https://learn.microsoft.com/en-us/dotnet/api/system.threading.tasks.parallel.foreachasync?view=net-8.0
Parallel.ForEachAsync Method (System.Threading.Tasks)
Executes a for-each operation on an IEnumerable in which iterations may run in parallel.
Whoops, I forgot that function. Basically it's a user-defined choice of parallel vs sequential.