From e31dd966ff522dfbeece1df87f7789a7c8e3a3d7 Mon Sep 17 00:00:00 2001 From: Elizabeth Mattijsen Date: Tue, 27 Mar 2018 23:00:46 +0200 Subject: [PATCH] Revert "Make affinity-threshold calculation simpler" This reverts commit 04014cf67d89606c5cbe6b3007b9784c8e8d2407. This is the wrong way to do it --- src/core/ThreadPoolScheduler.pm6 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/ThreadPoolScheduler.pm6 b/src/core/ThreadPoolScheduler.pm6 index 08160b173e1..209a2d315c3 100644 --- a/src/core/ThreadPoolScheduler.pm6 +++ b/src/core/ThreadPoolScheduler.pm6 @@ -373,7 +373,7 @@ my class ThreadPoolScheduler does Scheduler { ) } - constant @affinity-add-thresholds = 0, 1, 5, 10, 20, 50, 100; + constant @affinity-add-thresholds = 1, 5, 10, 20, 50, 100; method !affinity-queue() { # If there's no affinity workers, start one. nqp::unless( @@ -434,7 +434,7 @@ my class ThreadPoolScheduler does Scheduler { # worker thread. my $chosen-queue := $most-free-worker.queue; my $threshold = @affinity-add-thresholds[ - $cur-affinity-workers.elems min @affinity-add-thresholds + ($cur-affinity-workers.elems min @affinity-add-thresholds) - 1 ]; if $chosen-queue.elems > $threshold { # Add another one, unless another thread did too.