removed binary and ex10b
[des2015.git] / mart / ex03 / explanations.txt
index f53474f..5ae580a 100644 (file)
@@ -2,5 +2,12 @@
 Since the first task is started first the main loop halts until it's finished.
 
 3b.
+This works because the semaphore queue is FIFO. So the first one locks the
+semaphore to update the global variable, the second task also wants to do this
+but he has to wait in the queue and will be the next in line. After the first
+task releases the semaphore the second task locks it and the first task has to
+line up in the queue again. This goes on, tasks taking turns, till the tasks
+are finished.
 
 3c.
+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.