Stop
running
blocking
IO
actions
on
bounded
thread
pools.
Seriously. This is one of the hardest semantic issues to catch in code review. You can’t unit test it. It really only shows up in production, under load, as an ambiguous slow down.
-
-
Replying to @djspiewak
I’m wondering though what do you propose to do instead? Let them roam free, create more and more logical threads, eating away your CPUs soul one context switch at the time?
1 reply 0 retweets 0 likes -
Replying to @elmanu
Put them on an unbounded caching pool and bound things at a higher semantic level. Relying on thread starvation to bound things is horrible for throughput.
3 replies 2 retweets 6 likes -
Replying to @djspiewak @elmanu
+1 - higher level semaphores are great for this kind of thing.
1 reply 0 retweets 2 likes -
Any examples of how this might be achieved in a web server? Does limiting the number of simultaneous connections count as a "higher level semaphore"?
3 replies 0 retweets 0 likes
Yes, exactly!
12:54 PM - 20 Nov 2018
0 replies
0 retweets
0 likes
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.