Click here to Skip to main content
15,888,401 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: Whiskey Tango Foxtrot: On thread pooling, kernel waits and Microsoftisms Pin
Eddy Vluggen19-Jul-20 4:19
professionalEddy Vluggen19-Jul-20 4:19 
GeneralRe: Whiskey Tango Foxtrot: On thread pooling, kernel waits and Microsoftisms Pin
honey the codewitch19-Jul-20 4:30
mvahoney the codewitch19-Jul-20 4:30 
GeneralRe: Whiskey Tango Foxtrot: On thread pooling, kernel waits and Microsoftisms Pin
Eddy Vluggen19-Jul-20 5:21
professionalEddy Vluggen19-Jul-20 5:21 
GeneralRe: Whiskey Tango Foxtrot: On thread pooling, kernel waits and Microsoftisms Pin
honey the codewitch19-Jul-20 5:43
mvahoney the codewitch19-Jul-20 5:43 
GeneralRe: Whiskey Tango Foxtrot: On thread pooling, kernel waits and Microsoftisms Pin
Eddy Vluggen19-Jul-20 3:48
professionalEddy Vluggen19-Jul-20 3:48 
GeneralRe: Whiskey Tango Foxtrot: On thread pooling, kernel waits and Microsoftisms Pin
honey the codewitch19-Jul-20 3:49
mvahoney the codewitch19-Jul-20 3:49 
GeneralRe: Whiskey Tango Foxtrot: On thread pooling, kernel waits and Microsoftisms Pin
Eddy Vluggen19-Jul-20 4:05
professionalEddy Vluggen19-Jul-20 4:05 
GeneralRe: Whiskey Tango Foxtrot: On thread pooling, kernel waits and Microsoftisms Pin
honey the codewitch19-Jul-20 4:44
mvahoney the codewitch19-Jul-20 4:44 
Yeah 500 would be, just because you have all kinds of library code and framework code running along with your app code, and they need threads too.

When I design an app for throughput I do try to take that into consideration but it can only be found with profiling. Consequently, for me to know how many long running tasks i should be serving varies.

But otherwise I try to design as if I'm the only app running. The reason is if it's about moving and chunking bits fast, it's either a game, or some heavy app, or a server of some sort although those are mostly I/O bound except for things like game servers. But either way, the end user probably is aware of its requirements and will not expect it to run well with lots of other stuff going on.

The OS does a good job of scheduling its own threads so in practice I ignore OS stuff. It tends to background itself when an app is cranking anyway.

This is all just experiential. I used to write a lot of ISAPI code for work, and I had to think about what my threads were doing, and manage a "proper" thread pool. By "proper" I mean, it was directly tied to how many incoming I/O bound requests it was expected to serve - so it's a bit of a different animal but with similar concepts to say a game, or a computationally intensive app, like an mpeg encoder in that you head to very careful with how you were using the threads you had.

If I was writing something I/O bound and CPU bound, like a video player, i still wouldn't need a lot of threads. In the neighborhood of 3 depending on the system - one for I/O (so it's not tying up CPU), one for decoding (CPU bound), and one for rendering - usually tied with UI (CPU and/or GPU bound).


I guess thinking about it, I haven't run into a lot of middle ground with respect to app performance. Usually my apps either have to be casual about threading and simply reserve them for things that would lock up the UI, or they have to go full bore and do as much work as they can in the time given.

Even my parser generators were casual, despite sometimes being very long running - the LALR algorithm for example, is murder on the CPU and is resistant to being parallelized.

So maybe it's a dearth of experience on my part, wherein I would need more a "medium" app which might consistently need a lot of threads due to executing a lot of short lived but still too long for the UI tasks. I can imagine scenarios, but nothing not contrived seeming. Again, perhaps my own tunnel vision due to not finding one I've had to write.
Real programmers use butterflies

GeneralRe: Whiskey Tango Foxtrot: On thread pooling, kernel waits and Microsoftisms Pin
Eddy Vluggen19-Jul-20 5:37
professionalEddy Vluggen19-Jul-20 5:37 
GeneralRe: Whiskey Tango Foxtrot: On thread pooling, kernel waits and Microsoftisms Pin
honey the codewitch19-Jul-20 5:39
mvahoney the codewitch19-Jul-20 5:39 
GeneralRe: Whiskey Tango Foxtrot: On thread pooling, kernel waits and Microsoftisms Pin
Eddy Vluggen19-Jul-20 6:32
professionalEddy Vluggen19-Jul-20 6:32 
GeneralRe: Whiskey Tango Foxtrot: On thread pooling, kernel waits and Microsoftisms Pin
honey the codewitch19-Jul-20 6:51
mvahoney the codewitch19-Jul-20 6:51 
GeneralRe: Whiskey Tango Foxtrot: On thread pooling, kernel waits and Microsoftisms Pin
Eddy Vluggen19-Jul-20 7:29
professionalEddy Vluggen19-Jul-20 7:29 
GeneralRe: Whiskey Tango Foxtrot: On thread pooling, kernel waits and Microsoftisms Pin
honey the codewitch19-Jul-20 8:35
mvahoney the codewitch19-Jul-20 8:35 
GeneralRe: Whiskey Tango Foxtrot: On thread pooling, kernel waits and Microsoftisms Pin
Eddy Vluggen19-Jul-20 8:53
professionalEddy Vluggen19-Jul-20 8:53 
GeneralRe: Whiskey Tango Foxtrot: On thread pooling, kernel waits and Microsoftisms Pin
honey the codewitch19-Jul-20 9:09
mvahoney the codewitch19-Jul-20 9:09 
GeneralRe: Whiskey Tango Foxtrot: On thread pooling, kernel waits and Microsoftisms Pin
Eddy Vluggen19-Jul-20 12:54
professionalEddy Vluggen19-Jul-20 12:54 
GeneralRe: Whiskey Tango Foxtrot: On thread pooling, kernel waits and Microsoftisms Pin
honey the codewitch19-Jul-20 13:56
mvahoney the codewitch19-Jul-20 13:56 
QuestionRe: Whiskey Tango Foxtrot: On thread pooling, kernel waits and Microsoftisms Pin
Eddy Vluggen19-Jul-20 15:38
professionalEddy Vluggen19-Jul-20 15:38 
AnswerRe: Whiskey Tango Foxtrot: On thread pooling, kernel waits and Microsoftisms Pin
honey the codewitch19-Jul-20 16:21
mvahoney the codewitch19-Jul-20 16:21 
QuestionRe: Whiskey Tango Foxtrot: On thread pooling, kernel waits and Microsoftisms Pin
Eddy Vluggen25-Jul-20 12:50
professionalEddy Vluggen25-Jul-20 12:50 
AnswerRe: Whiskey Tango Foxtrot: On thread pooling, kernel waits and Microsoftisms Pin
honey the codewitch25-Jul-20 13:39
mvahoney the codewitch25-Jul-20 13:39 
AnswerRe: Whiskey Tango Foxtrot: On thread pooling, kernel waits and Microsoftisms Pin
honey the codewitch25-Jul-20 13:50
mvahoney the codewitch25-Jul-20 13:50 
AnswerRe: Whiskey Tango Foxtrot: On thread pooling, kernel waits and Microsoftisms Pin
Hooga Booga21-Jul-20 3:46
Hooga Booga21-Jul-20 3:46 
GeneralAbout Chuck Norris... PinPopular
Sander Rossel18-Jul-20 0:23
professionalSander Rossel18-Jul-20 0:23 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.