From chapter 2 of text book
Problem 16:
variation 1: Readers have priority. No writer when reader is active; when anew reader comes, it may start immediately unless awriter is currently active. When a writer finishes, all readers which are waiting are started, even if there are writers waiting.
variation2: Writers have priority. No reader may start when a writer is waiting. When the last active process finishes, a writer is started, if there is one; otherwise, all the readers which are waiting are started.
variation3: when a reader is active, new readres may start immediately. When a writer finishes, a waiting writer has priority.In other words, once a reader is in, readers keep reading and similarly, once a writer is in, writers keep writing (sequentially, of course). Switching happens by the last reader (no readers left) to finish and the last writer (no writers left)to finish.
Problem 19:
If aprocess occurs multiple times in the list, it will get multiple quanta per cycle. This approach can be used to give more important or selected processe a larger share of the cpu.
Problem 22:
For round robin, during the first 10 minutes each job gets 1/5 of the cpu. At the end of 10 minutes, C finishes. During the next 8 minute, each job gets 1/4 of the cpu, after which D finishes. Then each of the three remaining jobs gets 1/3 cpu for 6 minutes until B finishes and so on. The finish time for the jobs are 10, 18, 24, 28 and 30 - average of 22 minutes.
For priority scheduling, B is run first and finishes in 6 minutes. The other jobs finish at 14, 24, 26 and 30 minutes - average of 18.8 minutes.
If the jobs are run in the order A thru E, they finish at 10, 16, 18, 22, 30 - average of 19.2 minutes.
Finally, shortest job first results in finish times 2, 6, 12, 20, 30 - average of 14 minutes.
Problem 24:
The sequence of predictions are 40, (40+20)/2, ((40+20)/4+40/2) and (((40+20)/8+40/4)+15/2). calculated, it is 40, 30, 35, 25.
Problem 25:
Answer in section 2.4.7 of the text book.