You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This code does not work if we only start quark with cpus <= 60:
#include<iostream>
#include<thread>
#include<vector>
#include<atomic>
std::atomic<bool> run(true);
voidbusy_wait() {
while (run);
}
intmain() {
std::vector<std::thread> threads;
for (int i = 0; i < 60; ++i) {
threads.emplace_back(busy_wait);
}
// Let the threads run for a short durationstd::this_thread::sleep_for(std::chrono::seconds(5));
run = false;
for (auto& t : threads) {
if (t.joinable()) {
t.join();
}
}
std::cout << "All threads completed and exited." << std::endl;
return0;
}
It seems that when main thread goes to sleep, it can not wake up forever. Do you have any solution for this problem?
The text was updated successfully, but these errors were encountered:
This code does not work if we only start quark with
cpus <= 60
:It seems that when main thread goes to sleep, it can not wake up forever. Do you have any solution for this problem?
The text was updated successfully, but these errors were encountered: