Does Arduino need a real-time scheduler?

westfw:
Yeah, I think we need to stop thinking of the implementation, and start thinking about what the API should look like if it's going to be usable by "The Arduino Community."

timer mytimer;
void timerSet(mytimer, timeInms)
void timerSet(mytimer, hours, int minutes, int seconds)
boolean timerExpired(mytimer)
long timerTimeLeft(mytimer)

alarmClock myclock
alarmClockSet()
alarmSet(endTime)

In this case "timers" implement a delay for some duration, while alarmclocks implement checking whether some absolute time has ocurred.

How about simply "sleep(x);" like ...

code here; /* Last line to run before sleeping /
sleep(100); /
Thread goes to sleep here /
code here; /
Thread wakes up here after delay */

sleep(); causes THIS thread to release the CPU back to the RTOS.
Other threads can run while this thread is sleeping.
When the Timer Expires then the Interrupt allows the RTOS to "wake up" the sleeping thread.