4320/6320 Operating Systems Homework 3

43 阅读1分钟

Download link:4320/6320 Operating Systems Homework 3

Description

5/5 – (1 vote)

Your programs – if requested – must compile with gcc and execute on snowball.cs.gsu.edu!

Please see cscit.cs.gsu.edu/sp/guide/sn… for more details. You may use whatever

IDEs / text editors you like, but you must submit your responses on iCollege.

  1. Consider a system of 9 processes, P = {p1, …, p9}.

Associated with the system are 6 memory cells, M = {M1, …, M6}.

The domain and range for each process is given in the following table:

      • Process piDomain D(pi)Range R(pi)
        p1M1, M2M3
        p2M1M5
        p3M3, M4M1
        p4M3, M4M5
        p5M3M4
        p6M4M4
        p7M5M5
        p8M3, M4M2
        p9M5, M6M6

In addition, you are given the following precedence relation:

  • = {(P1,P2), (P1,P6), (P2,P3), (P2,P4), (P2,P5),(P3,P6),(P3,P8),(P4,P6), (P4,P7), (P5,P7), (P5,P8), (P6,P8), (P6,P9), (P7,P9), (P8,P9)}
  1. Construct the Precedence Graph (not containing any redundant edges; also modify è accordingly). Use PowerPoint, diagrams.net, or any other app to draw the graph. (15 points)
  1. Is the system above determinate for all interpretations of its processes? If it is not, add to è necessary elements to make it determinate (no graph drawing needed). Explain your reasoning. (20 points)
  1. In the first problem, there were 9 processes, many of which were listed as pairs under the precedence relation. Suppose we are now dealing with a system of only 5 processes named P1 through P5. You

are given a set of constraints that are expressed by the following precedence relation:

  • = {(P1,P3), (P1, P5), (P2,P4), (P3, P4), (P4, P5)}

Fall 2022 – 4320/6320 Operating Systems

Provide pseudocode for each of those 5 processes to show how semaphores can be used to enforce these constraints (i.e., the precedence relation è). Also, you must initialize these semaphores correctly (15 points).