Completed exercise 3, 6, 7
[des2015.git] / natanael / ex03 / ex03_explanation.txt
1 ex03a
2 The output shows the task one is started first and it does the looping to increase the Global variable. After that, the task two is started to decrease the Global variable
3
4 ex03b
5 Semaphores are used to communicate between tasks. In this case, task one communicates with the task two. After one cycle of looping in task one finished, the task two takes control and it does the one cycle of looping. Then it will come back to Task One again. So, task one and task two do the one cycle of looping alternately.
6
7 ex03c
8 Using semaphore, we can start task that has higher priority than the others. As we can see from the output, the order of the task is based on its priority.