3 ms·
The CPU is a resource too, for which there is contention just as for other resources such as files. Therefore, at every machine instruction, you are implictly p
by amelius 11y ago
The CPU is a resource too, for which there is contention just as for other resources such as files. Therefore, at every machine instruction, you are implictly performing a potentially blocking operation. (In a pre-emptive environment.)
Unless you are in a critical section (in which your thread has exclusive control of the CPU). So the blocking may start again at the end of the section.
I hope this makes it clear.
- gpderetta 11y agoAny scheduler worth anything guarantees forward progress which makes preemption very different from actual blocking.
- mtanski 11y agoOn Linux you can guarantee (with some effort) that your process / thread will be the only thing running on a core. There's a boot parameter that will let you black list CPUs on which to not schedule anything (by default). Then you use tasksel to schedule your process there as well. Finally, you can configure IRQ affinity so also doesn't handle interrupts on that core. It's not a 100% non pre-emptive but pretty close. I believe there was work being to enable it to be even more accurately 100 but I haven't followed along.