Re:The Unscalable, Deadlock-Prone, Thread Pool
by fiter on Tuesday February 26, 2019 @11:10PM
(#19260800)
The .NET libraries make it easy to use the default thread pool (a single pool). If other libraries are similar, then I wouldn't consider this a complete straw man.
Re:The Unscalable, Deadlock-Prone, Thread Pool
by eurg on Wednesday February 27, 2019 @05:55AM
(#19262410)
Yes, but the .NET thread pool is auto-tuning, although very badly, with at least a second latency to increased workload. For bursty requests that could be done within a few hundred milliseconds it is a bad fit. But you can't DOS your batch processing server so easily.
Re:The Unscalable, Deadlock-Prone, Thread Pool
by tybit on Wednesday February 27, 2019 @05:19AM
(#19262265)
Nonetheless the single thread pool in .net core seems to scale really well.
Re:The Unscalable, Deadlock-Prone, Thread Pool
by commandlinefan on Wednesday February 27, 2019 @12:13PM
(#19264794)
> Like, really badly: the strawman
Maybe so, but I've seen this pattern a LOT.
Re:The Unscalable, Deadlock-Prone, Thread Pool
by mcqueenjordan on Wednesday February 27, 2019 @05:23PM
(#19267493)
Fair point. I haven't seen it much, but I don't doubt that it happens.
I just wanted to emphasize the point, which wasn't clear, that ThreadPools aren't bad, but rather that bad uses of them are bad.
Re:The Unscalable, Deadlock-Prone, Thread Pool
by lemmsjid on Tuesday February 26, 2019 @10:43PM
(#19260676)
Agreed. I feel that he should engage with the actor model in this article or a subsequent one because it seems to me like the type of abstraction he’s searching for. E.g. where each actor generally performs one type of work, each has a mailbox with a variety of parallelism strategies, message passing semantics discourage deadlock scenarios... Not a perfect solution but one to discuss when talking about the problems he’s trying to solve.
In fact, "The Unscalable, Deadlock-Prone, Thread Pool" is only referring to a badly used ThreadPool. Like, really badly: the strawman that forms the crux of the argument is that you are only using the same ThreadPool for all of your disparate forms of work.
> My favourite approach assigns one global thread pool (queue) to each function or processing step.
Yes, creating different thread pools for different kinds of work is a much better way to use them...