mart week 2
[des2015.git] / mart / ex03 / explanations.txt
1 3a.
2 Since the first task is started first the main loop halts until it's finished.
3
4 3b.
5 This works because the semaphore queue is FIFO. So the first one locks the
6 semaphore to update the global variable, the second task also wants to do this
7 but he has to wait in the queue and will be the next in line. After the first
8 task releases the semaphore the second task locks it and the first task has to
9 line up in the queue again. This goes on, tasks taking turns, till the tasks
10 are finished.
11
12 3c.
13 rt_sem_v doesn't work because they are released and the first one will get the
14 lock. rt_sem_broadcast works because all tasks are released at the same time
15 and the priority is then the next measure of who goes first.