Код: Выделить всё
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
using namespace std::chrono;
std::atomic running{true};
void tight_loop_latency_probe(int cpu_id, uint64_t threshold_ns = 100000, int rt_priority = 99) {
cpu_set_t cpuset;
CPU_ZERO(&cpuset);
CPU_SET(cpu_id, &cpuset);
if (sched_setaffinity(0, sizeof(cpuset), &cpuset) != 0) {
perror("sched_setaffinity");
return;
}
std::cout
Подробнее здесь: [url]https://stackoverflow.com/questions/79580666/understanding-the-reasoning-behind-periodic-latency-spikes-on-aws-50-ms[/url]