Joe_Groff
(Joe Groff)
June 17, 2021, 7:13pm
8
Paul_Cantrell:
Thanks, that’s helpful. Checking if I understand correctly: merely creating separate actors will allow long-running partial tasks (i.e. code that runs for a long time without awaiting or yielding) to execute in parallel, but will not introduce extra threads even if all available threads fill with such long-running partial tasks? (And IIRC there is ~1 thread / CPU core in the default cooperative pool?)
And in principle, the runtime could observe that the thread pool is choked up with such tasks, and automatically create new threads to let preemptive multitasking allow blocked tasks to continue — but that runs against the goal of avoiding thread explosions?
Right. Adding new threads to maintain forward progress is how GCD works, for instance, and it has long been a source of unfixable performance problems because it is easy to accidentally trigger unbounded thread explosion.
7 Likes