docs: refine worker choice strategies README
[poolifier.git] / src / pools / selection-strategies / README.md
index 0e49d6dfb3f5b95dea9169c8746c0a7692f0cf6f..d7619e0bf84fc4a70c09c1de11739e57f50f6fc8 100644 (file)
@@ -1,5 +1,7 @@
 # Worker choice strategies
 
+All duration or timestamp are expressed in milliseconds.
+
 ## Strategies
 
 ### Fair share
@@ -9,14 +11,18 @@ By default, the strategy uses the average task execution time for each worker bu
 
 ### Weighted round robin
 
-The strategy assigns the next task using a robin round algorithm. The worker weights are maximum tasks execution time, once the worker has reached its maximum tasks execution time, the next task is assigned to the next worker.
+The worker weights are maximum tasks execution time, once the worker has reached its maximum tasks execution time, the next task is assigned to the next worker. The worker default weights are the same for all workers and is computed given the CPU cores speed and theirs numbers.
 
 ### Interleaved weighted round robin
 
+The worker weights are maximum tasks execution time. The rounds are the deduplicated worker weights.  
+During a round, if worker weight is inferior to the current round, the next task is assigned to the next worker. Once the all workers have been assigned a task, the next round starts.  
+The worker default weights are the same for all workers and is computed given the CPU cores speed and theirs numbers. So the default rounds consists of a unique worker weight.
+
 ## Statistics
 
 Worker choice strategies enable only the statistics that are needed to choose the next worker to avoid unnecessary overhead.
 
 ### Median
 
-Strategies using the average task execution time for each worker can use the median instead. Median is more robust to outliers and can be used to avoid assigning tasks to workers that are currently overloaded. Median usage introduces a small overhead: measurement history must be kept for each worker and the median must be recomputed each time a new task has finished.
+Strategies using the average task execution time for each worker can use the median instead. Median is more robust to outliers and can be used to avoid assigning tasks to workers that are currently overloaded. Median usage introduces a small overhead: measurement history must be kept for each worker and the median must be recomputed each time a task has finished.