Open VariableClass opened 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
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