diff --git a/src/vault/gear/work-force.hpp b/src/vault/gear/work-force.hpp index 9ab158996..2a9ff1b1e 100644 --- a/src/vault/gear/work-force.hpp +++ b/src/vault/gear/work-force.hpp @@ -79,6 +79,10 @@ namespace gear { using std::this_thread::sleep_for; + namespace { + const double MAX_OVERPROVISIONING = 3.0; ///< safety guard to prevent catastrophic overprovisioning + } + namespace work { ///< Details of WorkForce (worker pool) implementation using SIG_WorkFun = activity::Proc(void); ///< config should define a callable with this signature to perform work @@ -227,8 +231,7 @@ namespace gear { activate (double degree =1.0) { size_t scale{setup_.COMPUTATION_CAPACITY}; - scale *= degree; - scale = util::max (scale, 1u); + scale = size_t(util::limited (0.0, degree*scale, scale*MAX_OVERPROVISIONING)); for (uint i = workers_.size(); i < scale; ++i) workers_.emplace_back (setup_); } diff --git a/wiki/thinkPad.ichthyo.mm b/wiki/thinkPad.ichthyo.mm index a02383649..e35327103 100644 --- a/wiki/thinkPad.ichthyo.mm +++ b/wiki/thinkPad.ichthyo.mm @@ -93345,9 +93345,82 @@ Date:   Thu Apr 20 18:53:17 2023 +0200
- + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+ 2023-09-07 17:15:25 +

+

+ Workforce: configuration and initialisation of workers +

+ + +
+
+ + + + + + + +

+ es paßt nicht zum Stil im gesamten Kontext; wir sind hier in Implementierungs-Code, der grundsätzlich davon ausgeht, nur sinnvoll aufgerufen zu werden — es geht nicht darum, einen User „an die Hand zu nehmen“ +

+ + +
+
+
+ + + + + + + + + + + + +
+
+ + +
@@ -95970,6 +96043,12 @@ Date:   Thu Apr 20 18:53:17 2023 +0200
+ + + + + +