Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/ThreadPool.h
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,11 @@ class ThreadPoolWithEnqueueFast : public ThreadPool {
void Barrier() override {
while (fast_queue_size_.load(std::memory_order_relaxed)) {
assert(worker_thread_);
// spin on the CPU's pause hint; std::this_thread::yield() is an OS syscall
#ifdef __x86_64__
__builtin_ia32_pause();
#elif defined(__aarch64__)
__asm__ __volatile__("yield");
#else
std::this_thread::yield();
#endif
Expand Down
Loading