Long and background tasks What we miss in the previous approach is Support for tasks that must use all "free" CPU time Support for the random "long" job duration Typical "long" tasks: A command shell on the serial port Data communication, over serial or USB (or whatever) To support that, we really need preemption We can special-case some of them We accept that the console is just a debugging tool It can temporary halt scheduling And we know for sure it won't run in production But data communication takes time We must prepare our frames, possibly with printf too This happens rarely, but then it's a few hundred microseconds Or even several milliseconds on the UART port