CountDivTen; } } MyCounters[index] = local; } void DoThreadUsingMerge() { // Start timer std::chrono::high_resolution_clock::time_point StartTime = std::chrono::high_resolution_clock::now(); // Create four Threads std::vector<std::thread> MyThreads(4); // Create Threads for (siz...
10000000000}};std::vector<Counters>MyCounters(4);voidSingleThreaded(){std::chrono::high_resolution...
int num1; void thread0(int index){ SetCPUaffinity(index); int count = 100000000; // 1亿 while(count--){ num0++; } return; } void thread1(int index){ SetCPUaffinity(index); int count = 100000000; while(count--){ num1++; } return; } int main(){ vector<std::thread> pools; ...
CountDivTen; } } MyCounters[index] = local; } void DoThreadUsingMerge() { // Start timer std::chrono::high_resolution_clock::time_point StartTime = std::chrono::high_resolution_clock::now(); // Create four Threads std::vector<std::thread> MyThreads(4); // Create Threads for (...