Improvement: Create less threads when there isn't enough data to transfer (#2838)
* Improvement: Create only necessary threads when there isn't enough data to transfer * Update sdk/storage/azure-storage-common/inc/azure/storage/common/internal/concurrent_transfer.hpp * CL
This commit is contained in:
parent
47d04c3ff9
commit
6611b8f03f
@ -12,6 +12,8 @@
|
||||
|
||||
### Other Changes
|
||||
|
||||
- Create less threads if there isn't too much data to transfer.
|
||||
|
||||
## 12.1.0 (2021-08-10)
|
||||
|
||||
### Features Added
|
||||
|
||||
@ -54,7 +54,7 @@ namespace Azure { namespace Storage { namespace _internal {
|
||||
};
|
||||
|
||||
std::vector<std::future<void>> threadHandles;
|
||||
for (int i = 0; i < concurrency - 1; ++i)
|
||||
for (int i = 0; i < std::min<int64_t>(concurrency, numChunks) - 1; ++i)
|
||||
{
|
||||
threadHandles.emplace_back(std::async(std::launch::async, threadFunc));
|
||||
}
|
||||
|
||||
@ -12,6 +12,8 @@
|
||||
|
||||
### Other Changes
|
||||
|
||||
- Create less threads if there isn't too much data to transfer.
|
||||
|
||||
## 12.1.0 (2021-08-10)
|
||||
|
||||
### Features Added
|
||||
|
||||
@ -12,6 +12,8 @@
|
||||
|
||||
### Other Changes
|
||||
|
||||
- Create less threads if there isn't too much data to transfer.
|
||||
|
||||
## 12.1.0 (2021-08-10)
|
||||
|
||||
### Bugs Fixed
|
||||
|
||||
Loading…
Reference in New Issue
Block a user