Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Synchronizing the execution of multiple tasks by broadcasting to a semaphore is a commonly used technique. It may be important to have multiple tasks start executing at the same time. Obviously, on a single processor, only one task will actually execute at one time. However, the start of their execution will be synchronized to the same time. This is called a multiple task rendez-vous. However, some of the tasks synchronized might not be waiting for the semaphore when the broadcast is performed. It is fairly easy to resolve this problem by combining semaphores and event flags, as shown in Figure 14-11. For this to work properly, the task on the left needs to have a lower priority than the tasks waiting on the semaphore.

Image Removed

Figure 14-11 Multiple Task Rendezvous

F14-11(1) Each task that needs to synchronize at the rendez-vous needs to set an event flag bit (and specify OS_OPT_POST_NO_SCHED).

...