Forgot to mention that those pulses of course are longer than 10 sampling periods. But you can reduce it significantly if will run each task separately in different time slots.
Timer constantly generates required slots.
Sampling ports and doing RS232 for instance are constant rate processes. Those should be sampled by every pass but finding edges can be scheduled for later. This is compatible with the SX Demo Board from Parallax, and is the same code is shipped with the Parallax tools. This is not compatible with the SX Demo Board from Parallax, but is a very impressive demonstration of the type of power that software can provide on the right kind of silicon. Scenix' implementation of this reliable protocol on a SX microcontroller is achieved by relying on the application's ability to re-send data upon request rather than the traditional use of large data buffers.