Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I definitely agree with the n+1, however when you're dealing with HyperThreading I don't know that I'd bother. The extra 'cores' provided by HyperThreading are not full cores.

The idea behind HyperThreading is basically the same as your n+1 idea. A HyperThreaded core has duplicated circuitry to handle state (registers, etc) but not the execution resources. When one thread is stalled/not using the execution resources (e.g., waiting on disk IO, waiting on a fetch from RAM, etc), the other thread is already in processor ready to go and will be executed instead.

Obviously this is a bit of a simplification, but your n+1 idea is essentially already implemented in the hardware.

That said, if enough of your cores are still stalled waiting on disk/memory access and are stalled long enough to make the context switch worth it, it may be beneficial. If not, however, you might actually end up seeing some minor slow down as the processor is forced to switch between the competing processes.

I'd benchmark it.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: