41/317
2 - How does a typical microcontroller work?
2.6.2 Cooperative multitasking
Cooperative multitasking draws its name from the fact that task switching is not spontaneous.
It only occurs when the task-switching function is called by the currently active task. This im-
plies two facts:
Task switching occurs only when the code decides it. As a consequence, it is easy to avoid
data desynchronization and access collisions by placing the task switching calls at the
proper places.
The partitioning of the core time between tasks cannot be set at will, since it is not possible
either to insert into the code as many calls to the switching function as necessary or to put
them at the right places to control the time intervals allocated to that task.
The reader can easily see that the strong and the weak points of one type of multitasking are
the opposite to those of the other system. This explains why both are used, the type being
chosen to best match the application's requirements. In addition to theses features it is fair to
say that cooperative multitasking is easier to implement and less resource-consuming than its
competitor.
02-coop
Task 1
Next task
(Yield)
Cooperative multitasking ; simplified example
Task 2
Next task
(Yield)
Task 3
Next task
(Yield)
Содержание ST7 Series
Страница 1: ...ST7 8 BIT MCU FAMILY USER GUIDE JANUARY 1999 1 ...
Страница 238: ...238 317 8 C Language and the C Compiler 08 Burn bmp Then use the EPROMer programmer software as described in Chapter 7 ...
Страница 289: ...289 317 10 Second Application a Sailing Computer 10 befor Bs Rw Vw VMG AlphaR AlphaV Before the wind ...