|
|
|
|
|
by com2kid
2688 days ago
|
|
It served a similar purpose, if no one else scheduled anything anytime soon. The schedule task function in this particular embedded OS actually didn't guarantee it'd call you at the specified timeout, the contract was that it'd invoke the callback no sooner than the specified timeout! Timer coalescing and all that. Irritated the heck out of the traditional embedded engineers when they first got introduced to it though. "I know this operation will take this many microseconds, can't I just sleep until it is done and the results are waiting for me?" Not allowed! Plenty of old school engineers are used to just spinning the CPU while waiting for something to happen! |
|
This is the contract for sleep on just about every general purpose OS preemptive or cooperative, and what would be assumed in the original article.
> I know this operation will take this many microseconds, can't I just sleep until it is done and the results are waiting for me?"
I mean now we're just conflating so many things. What you describe here is the essence of a hard real-time OS. It's quite orthogonal to the issue of ensuring low power. Since there are plenty of systems that require both.
> Plenty of old school engineers I can assure you there are plenty of old school engineers that can get an MCU to run for months on a couple AA batteries. They're not spinning a 20MHz CPU in a busy-loop most of the time.