Azure / azure-cosmosdb-bulkexecutor-dotnet-getting-started

Bulk Executor Utility for Azure Cosmos DB .NET SQL API
MIT License
66 stars 41 forks source link

Non-threadsafe references #66

Open VariableClass opened 4 years ago

VariableClass commented 4 years ago

As far as I can make out, these variables should be referenced in a thread-safe manner since they are modified across tasks, perhaps utilising Interlocked.Add? Alternatively, the responses could be iterated post-execution and the values summed then.

https://github.com/Azure/azure-cosmosdb-bulkexecutor-dotnet-getting-started/blob/cb54c8624ade7731d40f08fb61f1bc1fa9f2d8ff/BulkImportSample/BulkImportSample/Program.cs#L133-L135

https://github.com/Azure/azure-cosmosdb-bulkexecutor-dotnet-getting-started/blob/cb54c8624ade7731d40f08fb61f1bc1fa9f2d8ff/BulkImportSample/BulkImportSample/Program.cs#L198-L200