From 2d3528431b1c1d882dd9facb568c092193dc44a8 Mon Sep 17 00:00:00 2001 From: "Antonio S. Musumeci" Date: Fri, 10 Apr 2026 18:20:14 -0400 Subject: [PATCH] thread_pool: use producer token on fast path of enqueue_work_autoscale The PToken overload of enqueue_work_autoscale passed ptok_ to the blocking fallback enqueue but not to the try_enqueue fast path. BoundedQueue has a try_enqueue(PToken&, ...) overload, so the token was silently ignored on the common (non-full) path, forgoing the per-producer thread-local allocation that moodycamel provides. Pass ptok_ through to try_enqueue so the fast path benefits from the same producer-token locality as the fallback path. Co-Authored-By: Claude Opus 4.6 (1M context) --- vendored/libfuse/include/thread_pool.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vendored/libfuse/include/thread_pool.hpp b/vendored/libfuse/include/thread_pool.hpp index 9b3b7339..94d767e3 100644 --- a/vendored/libfuse/include/thread_pool.hpp +++ b/vendored/libfuse/include/thread_pool.hpp @@ -1059,7 +1059,7 @@ ThreadPool::enqueue_work_autoscale(ThreadPool::PToken &ptok_, // that could violate this ordering. Func f(std::forward(func_)); - if(_queue.try_enqueue(std::move(f))) + if(_queue.try_enqueue(ptok_,std::move(f))) { _tasks_enqueued.fetch_add(1,std::memory_order_relaxed); return;