3 ms·
yielding per-se is not a blocking operation, otherwise no algorithm would be non-blocking would under preemptive scheduling. It could be considered a potentiall
by gpderetta 10y ago
yielding per-se is not a blocking operation, otherwise no algorithm would be non-blocking would under preemptive scheduling. It could be considered a potentially blocking operation if scheduling is exclusively cooperative.
- amelius 10y agoThe 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 10y agoAny scheduler worth anything guarantees forward progress which makes preemption very different from actual blocking.
- mtanski 10y 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.