Commit graph

11 commits

Author SHA1 Message Date
997fc36c81 Workforce: implementation complete 2023-09-09 23:42:13 +02:00
397ded86df Workforce: verify error handling and wait on shutdown
...seemingly the implementation is complete now
2023-09-09 03:31:46 +02:00
9ccdfa24f7 Workforce: invoke a exit hook prior to worker termination
...essential for clean-up work, especially to drop
claimed resources reliably, even in case of error.
2023-09-09 02:31:16 +02:00
dd62240900 Workforce: terminate after excessive idle cycles
- count each consecutive idle cycle
- by default, terminate after 100 idle cycles (2 sec)
2023-09-09 01:47:15 +02:00
b493f15333 Workforce: configure and demonstrate idle-wait 2023-09-09 01:12:10 +02:00
67a3e87dbc Workforce: demonstrate controlled worker-stop
- workers can be controlled by the return-value from the work functor
- this test could be brittle, since it's based on timing and CPU speed
2023-09-08 14:32:37 +02:00
ef5365057a Workforce: demonstrate standard behaviour
- can activate / scale up
- work functor invoked repeatedly
2023-09-08 14:07:23 +02:00
81cab9a675 Workforce: emergency brake
While in principle it would be possible (and desirable)
to control worker behaviour exclusively through the Work-Functor's return code,
in practice we must concede that Exceptions can always happen from situations
beyond our control. And while it is necessary for the WorkForce-dtor to
join and block (we can not just pull away the resources from running threads),
the same destructor (when called out of order) must somehow be able
at least to ask the running threads to terminate.

Especially for unit tests this becomes an obnoxious problem -- otherwise
each test failure would cause the test runner to hang.

Thus adding an emergency halt, and also improve setup for tests
with a convenience function to inject a work-function-λ
2023-09-08 02:48:30 +02:00
b8e52d008c Workforce: configuration and initialisation of workers
- use a template parameter to allow for hook into local facilities (Scheduler)
- pass config initialisation down through constructors
2023-09-07 17:15:25 +02:00
38ab5a6aa9 Workforce: draft simple usage
...start with an oversimplified implementation...
2023-09-05 00:24:33 +02:00
70cd8af806 Workforce: requirement analysis 2023-09-05 00:22:17 +02:00