It would be nice if there was a global bit that would be turned on whenever an interrupt occurred. If you use a simple main loop and want to sleep when there is nothing to do, such a bit can be used to insure all tasks "scheduled" by interrupts are run before sleeping. The bit would be cleared by the main loop after returning from sleep. It would be checked by the main loop after all tasks are checked and just before sleeping. If the bit is set, the sleep is skipped. Going around the loop again will enable all tasks to be run. The AVR keeps spinning around the loop until the bit is clear at the end of the loop, and only then it sleeps.
Of course if only one interrupt happens, it will awaken the CPU, the loop will run, and all will be well. But if a second interrupt occurs while executing the loop, and it "schedules" a task that has already been checked, the loop will sleep without running that task unless it checks this "interrupt happened" bit.
This bit can be implemented by the software but it's a pain and the AVR could do it easier.
If they wanted to make the programmer's work even easier, the sleep enable bit could be used. The loop would set it after returning from sleep. An interrupt would clear it. Thanks to Lee for dreaming that one up. Atmel won't do that though because they keep advising me to keep sleep disabled until just before sleeping. But I keep ignoring their advice because it doesn't make much sense to me.