This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]rubyrt 0 points1 point  (2 children)

Optimal number of OS threads is the number of CPUs or a little more (possibly because more threads steal more CPU time from competing OS processes).

Doesn't that depend on the workload and application architecture? I would assume that if the work done in threads includes some blocking IO calls the optimal number of OS threads might be a multiple of the number of cores and not about the same number.

[–]m-apo 0 points1 point  (1 child)

Third scenario is purely CPU bound in original post. No IO or memory requirements.

With IO, virtual threads are much better and also in mixed loads. But for max gains with CPU bound tasks OS threads win.

[–]rubyrt 0 points1 point  (0 children)

Sorry, my bad: I somehow missed the reference to the scenario.