Sönke Ludwig
6caff0b105
Fix synchronization and shutdown issues in TaskPool.
...
- terminate() would hang if called from a worker thread because it would attempt to self-join
- the handleWorkerTasks could miss signal emits, resulting in a hanging task queue or a missed termination signal
2018-10-27 00:42:06 +02:00
Sönke Ludwig
849bca4855
Avoid starting an explicit event loop in worker threads.
...
This reduces the overhead of task pool threads slightly and simplifies stack traces in case of errors.
2018-10-23 11:27:28 +02:00
Sönke Ludwig
7703cc675f
Fix a race-condition in TaskPool.
...
The lock that should surround the foreach loop was given up prematurely.
2018-03-07 10:39:28 +01:00
Sönke Ludwig
0dbebac482
Add TaskPool.threadCount property.
2017-09-21 13:38:24 +02:00
Sönke Ludwig
a60828d6da
Mark more classes as final.
2017-07-23 15:04:11 +02:00
Sönke Ludwig
bfc6b89ca4
Use abort() in case of uncaught Error exceptions.
...
Fixes "dwarfeh(224) fatal error" that are suspected to be related to occasional infinite loops.
2017-07-19 00:11:12 +02:00
Sönke Ludwig
0895cd1960
Avoid bogus assertion failure.
...
Since the task queue entries never got cleaned up, the assertion got triggered once already used queue slots were starting to get reused.
2017-03-27 16:31:52 +02:00
Sönke Ludwig
b995bdaa72
Use thread wait primitives for worker thread shutdown.
...
Avoids possible issues due to tasks interleaving the shutdown on the same thread.
2017-02-23 14:43:22 +01:00
Sönke Ludwig
76882b3bd7
Remove temporary debug log messages.
2017-02-22 19:58:11 +01:00
Sönke Ludwig
9ac908c599
Use a ring buffer for worker tasks and make TaskFuncInfo creation slightly more efficient.
2017-02-22 19:52:22 +01:00
Sönke Ludwig
40713db075
Move worker task logic into a new TaskPool class.
2017-02-22 18:35:51 +01:00