by LowerThanZero · 6y ago · 0 comments
So it's a matter of perspective I guess. You don't want to poll in your code and you want to let the kernel do the job for you. Does it mean that the kernel doesn't poll? Not necessarily; The kernel itself might be forced to "poll" (e.g. the device driver can't do otherwise) or it can outsource ;-) the dirty and time consuming poll job to a peripheral which in turn will have an embedded CPU and firmware.
Bottom line: if you poll it is GUARANTEED to be a waste of time and CPU cycles but if you let the kernel do it there's a chance that the system might do a better overall job. That's because main CPU time is really expensive while peripheral CPU resources might be cheaper in the big picture so ultimately it's not a "poll vs. no poll" but rather "specialized poll vs wasteful poll"
No comments yet.