2 ms·
>Hardware context switching is quite fast and overhead free." Everything I have read on hardware switching has indicated otherwise: From: https://wiki.osdev.
by bogomipz 8y ago
>Hardware context switching is quite fast and overhead free."
Everything I have read on hardware switching has indicated otherwise:
From:
https://wiki.osdev.org/Context_Switching#Hardware_Context_Switching https://wiki.osdev.org/Context_Switching#Hardware_Context_Sw...
>"Performance Considerations
Because the hardware mechanism saves almost all of the CPU state it can be slower than is necessary. For example, when the CPU loads new segment registers it does all of the access and permission checks that are involved. As most modern operating systems don't use segmentation, loading the segment registers during context switches may be not be required, so for performance reasons these operating systems tend not to use the hardware context switching mechanism. Due to it not being used as much CPU manufacturers don't optimize CPUs for this method anymore (AFAIK). In addition the new 64 bit CPU's do not support hardware context switches when in 64 bit/long mode."
- zaarn 8y agoI mentioned this in my comment, with software ctxs you can save a bit of time if you don't need to save and restore everything. Outside that, hw ctxs is faster.