4320/6320 Operating Systems Homework 4

51 阅读1分钟

Downlload link:# 4320/6320 Operating Systems Homework 4

Description

5/5 – (2 votes)

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. (10 Points)  Provide a deadlock-prone pseudocode for two processes each accessing two semaphores A and B.
  1. (20 Points)  Prove the correctness or give a counterexample for each of the following statements. You must state whether the statement is true or false and then show your arguments. (“->” means “implies”).
    1. Cycle -> Deadlock
    1. Knot -> Deadlock
  1. (20 Points)  Consider the following maximum-claim reusable resource system with four processes (P0, P1, P2, P3) and three resource types (R0, R1, R2). The maximum claim matrix C is given by
      • P****0R****0R****1R****2
        414
        P****1314
        P****25613
        P****3116

where Cij denote maximum claim of process i for resource j. The total number of units of each resource type is given by the vector

          • R0R1R2
            5815

The current allocation of resources is given by the matrix A

      • P****0R****0R****1R****2
        014
        P****1201
        P****2121
        P****3103

where Ai,j denotes the units of resources of type j currently allocated to process i. For the state shown above, determine if a new request by process P1 for 1 unit of resource R1 can be safely granted. (Remark: You can assume that the system state above does not yet consider this request.)