State machines and timeslicing are two popular multitasking methods with long traditions. State machines have been used to design complex systems with high reliability requirements. State machines requires that the task is split into states. The state machine stays in one state at a time, and switch to another state when the specified conditions are met. Actions are performed during the transitions.
States represent a situation that is stable for some time interval.
State machines can be implemented on ALL PICmicros, also on the smallest PIC16C52. Timeslicing means that the kernel interrupts each process after some milliseconds and give control to another task. Thus, each task is given CPU processing at regular intervals. This mechanism is general but requires that the kernel can pop and push program addresses on the stack, and is thus not available on the midrange PICmicro devices. Designing processes for timeslicing is very similar to designing independent programs.