Skip to content

Commit

Permalink
Revert "Make affinity-threshold calculation simpler"
Browse files Browse the repository at this point in the history
This reverts commit 04014cf.

This is the wrong way to do it
  • Loading branch information
lizmat committed Mar 27, 2018
1 parent 04014cf commit e31dd96
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core/ThreadPoolScheduler.pm6
Expand Up @@ -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(
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit e31dd96

Please sign in to comment.