This is called pre-emptive tasking because any task might be temporarily suspended at any time. All reasonable commercial OSes support this form of preemptive multitasking, but carry the concept further. First, each task has a priority assigned to it. The highest priority tasks get all of the execution time until complete, blocked by a need for some sort of resource, or their priority is changed . Priority allocation is always dynamic so a critical action can gain more access to the CPU when something important is going on.
Asynchronous events can change execution order.
Generally an embedded system thrives on multiple interrupt sources. Homemade operating systems generally provide little more than some sort of tasking capability. Remember, though, that tasks will want to talk to each other. Without some sort of inter task communication protocol, they'll have no option other than using a zillion global variables. Globals are the source of world hunger, the deficit and ozone depletion.