MoveFast
MoveFast

Reputation: 3015

Multithreading useful upto what extent?

Upvotes: 0

Views: 135

Answers (1)

John Watson
John Watson

Reputation: 249

There are a number of factors here. You are only limited by the number of processors/cores if your tasks are CPU bound. If your tasks tend to be IO bound, then you will likely benefit from more threads than processors/cores. How many depends on how much time your tasks are spending waiting on IO, relative to how much time they spend doing actual compututations.

So, as usual, it depends on what you're doing.

For CPU bound processes, the number of running threads shouldn't need to exceed the number of cores.

In the end, you will need to try different configurations and see what works best.

Upvotes: 5

Related Questions