I have a question which I tried to find an answer for, but got more confused from all the information I found - unfortunately, couldn't gain a clear answer
So, let's say I have a coomputer with hyperthreading turned OFF.
What is the optimal number of threads I should use at a program I wrote?
I understand that if my program is NOT 100% CPU bound (deals with IO), so the optimal number of threads will be MORE than one thread per core - since I will have multi threads which are waiting, and having more (not too much due to context switching overhead) will be better for these kind of programs.
BUT, In case my program is 100% CPU bound - one thread per core is the optimal? I'm confused since having more threads, meaning maybe getting a bigger slice time for each thread - which can improve the performance.
Thanks!