cop4600-sp08-midtermSolutions

cop4600-sp08-midtermSolutions - COP4600 Operating Systems...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
COP4600 Operating Systems SOLUTIONS for MIDTERM EXAM February 26, 2008 Student Information Name: UFID: Signature: Important note: There are 4 questions. Please read the questions carefully. Good luck! 1
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Thread1 ready Thread1 ready Thread2 blocked Thread1 running Thread2 ready Thread1 running Thread2 running Thread2 running Thread2 blocked Thread1blocked Thread1 ready Thread2 ready Thread1 blocked Thread1 running Thread2 blocked Thread2 ready Thread1 blocked Thread2 running s0 s1 s2 s3 s4 s5 s6 s7 s8 Figure 1: All combinations of states of two user-level threads. Questions 1. (25 pts) Figure 1 shows the potential states of a process with two user-level threads (Thread1 and Thread2) in terms of combinations of individual thread states. Answer the following: (a) Which states are NOT possible? Answer: { s 0 , s 2 , s 6 , s 8 } . (b) Draw transitions (directed edges) among the states that are possible. Also, label each transition with a symbolic name such as t1, t2, etc. Answer: See Figure 2. (c) Which transition(s) take place when one of the threads call thread yield function of the run-time system? Answer: { t 5 , t 6 } . (d) Which transition(s) can be made by the operating system only (i.e., on which transitions the run-time system cannot have any affect)? Answer: { t 1 , t 2 , t 3 , t 4 , t 7 , t 8 , t 9 , t 10 } . (e) Which transition(s) can take place as a result of page faults in a system that uses paging? Answer: If page fault is caused by this process: { t 7 , t 8 } , if it is caused by another process { t 2 , t 3 } . 2
Background image of page 2
Thread1 ready Thread2 blocked Thread1 running Thread2 ready Thread1 running Thread2 running Thread2 running Thread2 blocked Thread1blocked Thread1 ready Thread2 ready Thread1 blocked Thread1 running Thread2 blocked Thread2 ready Thread1 blocked Thread2 running s0 s1 s2 s3 s4 s5 s6 s7 s8 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 Figure 2: All combinations of states of two user-level threads. 3
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 9

cop4600-sp08-midtermSolutions - COP4600 Operating Systems...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online