3 ms·
This highlights one of the advantages of context-switching in user space. The OS context switch can make few assumptions about the registers that actually need
by jandrewrogers 9y ago
This highlights one of the advantages of context-switching in user space. The OS context switch can make few assumptions about the registers that actually need to be preserved once a register set has been used. Many user space context libraries, on the other hand, only preserve the half dozen basic registers per the ABI by default (very fast) and let the programmer optionally preserve the other register sets. In the vast majority of cases, you never need to preserve any additional state at the logical context switch points even when you are using those additional registers in your application.
- frozenport 9y agoAlternatively juat grep the function source and ban self modifying code. Or run self modifying code in a "fuck you" performance sandbox.
- MichaelMoser123 9y agoRight. Boosts set_fcontext even allows to omit the floating point registers (saves a lot of time if the application doesn't do fp)