From af98b972cd1f5145852682b8167e4af0ff994260 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Wed, 27 Sep 2023 20:41:03 +0200 Subject: [PATCH] docs: refine task stealing documentation MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- CHANGELOG.md | 2 +- README.md | 2 +- docs/api.md | 4 ++-- src/pools/pool.ts | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8b7d694d..19b7b283 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -60,7 +60,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Add `startWorkers` to pool options to whether start the minimum number of workers at pool initialization or not. - Add `start()` method to pool API to start the minimum number of workers. -- Add `taskStealing` and `tasksStealingOnPressure` to tasks queue options to whether enable task stealing or not and whether enable tasks stealing on back pressure or not. +- Add `taskStealing` and `tasksStealingOnPressure` to tasks queue options to whether enable task stealing or not and whether enable tasks stealing under back pressure or not. - Continuous internal benchmarking: [https://poolifier.github.io/benchmark-results/dev/bench](https://poolifier.github.io/benchmark-results/dev/bench). ## [2.6.44] - 2023-09-08 diff --git a/README.md b/README.md index c0d1e26a..e7b7a5d1 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ Please consult our [general guidelines](#general-guidelines). - Tasks distribution strategies :white_check_mark: - Lockless tasks queueing :white_check_mark: - Queued tasks rescheduling: - - Task stealing :white_check_mark: + - Task stealing on empty queue :white_check_mark: - Tasks stealing under back pressure :white_check_mark: - Tasks redistribution on worker error :white_check_mark: - General guidelines on pool choice :white_check_mark: diff --git a/docs/api.md b/docs/api.md index 91185f77..f9af05a7 100644 --- a/docs/api.md +++ b/docs/api.md @@ -136,8 +136,8 @@ An object with these properties: - `size` (optional) - The maximum number of tasks that can be queued on a worker before flagging it as back pressured. It must be a positive integer. - `concurrency` (optional) - The maximum number of tasks that can be executed concurrently on a worker. It must be a positive integer. - - `taskStealing` (optional) - Task stealing enablement. - - `tasksStealingOnBackPressure` (optional) - Tasks stealing enablement on back pressure. + - `taskStealing` (optional) - Task stealing enablement on empty queue. + - `tasksStealingOnBackPressure` (optional) - Tasks stealing enablement under back pressure. Default: `{ size: (pool maximum size)^2, concurrency: 1, taskStealing: true, tasksStealingOnBackPressure: true }` diff --git a/src/pools/pool.ts b/src/pools/pool.ts index 118b2832..06989941 100644 --- a/src/pools/pool.ts +++ b/src/pools/pool.ts @@ -110,13 +110,13 @@ export interface TasksQueueOptions { */ readonly concurrency?: number /** - * Whether to enable task stealing. + * Whether to enable task stealing on empty queue. * * @defaultValue true */ readonly taskStealing?: boolean /** - * Whether to enable tasks stealing on back pressure. + * Whether to enable tasks stealing under back pressure. * * @defaultValue true */ -- 2.34.1