7 comments

[ 3.7 ms ] story [ 26.8 ms ] thread
Do compilers take advantage of these features?
I would think that task switching and interrupts are much slower than actual processor instructions. So there is no reason for compilers to use it.
A task/context switch involves dumping the entire contents of the registers and caches, loading the new values and resuming execution of the other task. It most likely messes up your pipeline - it's several orders of magnitude slower than just executing a simple instruction.
But what if you are running a task on an expensive supercomputer that bills you based on the number of instructions performed? :)