Skip to content

CS604 - Operating Systems

4 Topics 70 Posts
  • McQ Solved for Mid Tearm and Final Term

    Pinned
    9
    0 Votes
    9 Posts
    12k Views
    cyberianC
    @moaaz said in McQ Solved for Mid Tearm and Final Term: The condition in which a set {P0, P1… Pn} of waiting processes must exist such that P0 is waiting for a resource that is held by P1, P1 is waiting for a resource that is held by P2, and so on, Pn-1 is waiting for a resource held by Pn, and Pn is waiting for a resource held by P0. This condition is known as ______________. ►Mutual exclusion ►Hold and wait ►No preemption ►Circular wait (Page 131) The condition described is known as a “deadlock.” In the context of computer science and operating systems, a deadlock occurs when a set of processes are each waiting for a resource that another process in the set holds, creating a cycle of dependencies. Specifically, in the scenario you described: Process ( p_0 ) is waiting for a resource held by ( p_1 ), Process ( p_1 ) is waiting for a resource held by ( p_2 ), and so on, until Process ( p_n ) is waiting for a resource held by ( p_0 ). This creates a circular wait, which is one of the necessary conditions for a deadlock to occur. In a deadlock situation, none of the processes can proceed because each is waiting for a resource held by another process in the cycle.
  • 0 Votes
    1 Posts
    388 Views
    No one has replied
  • 0 Votes
    3 Posts
    879 Views
    zareenZ
    @zareen said in CS604 Assignment 3 Solution and Discussion: Question No 02 12 Marks Suppose a computer lab comprises of two printers, three scanners, and four ROM writers. There are three programs currently running on some computer. Assume program P1 is currently allocated a printer and two ROM writers and it is waiting for a scanner. Program P2 is allocated a scanner and it is waiting for a printer. Program P3 is allocated two ROM writers, a scanner, and a printer. Draw the corresponding resource allocation graph for these three programs. Also specify if the system is in a deadlocked state or not? [image: fEvrDBH.png] The system is not in deadlock state as it is clear from the above graph it is multi instance and circular weight.
  • CS604 Assignment 2 Solution and Discussion

    Solved cs604 solution discussion fall 2019 assignment 2
    8
    0 Votes
    8 Posts
    2k Views
    zareenZ
    Solution: Q. 1 Answer P0 P4 P3 P2 P1 P5 0 2 5 9 10 16 24 Total Waiting Time = 0+2+5+1+10+16 = 34 Seconds Average Waiting Time = 34/6 = 5.66 Seconds Q.2 Answer: Solution 1: P0 P1 P3 P0 P2 P3 P2 P3 P2 P2 0 8 16 24 31 39 47 55 57 65 66 Turnaround time= Exit Time- Arrival Time Turnaround time for P0 = 31-0 = 31 P1 = 16-4 = 12 P2 = 66-18 = 48 P3 = 57- 5= 52 Total Turnaround Time = 39+12+48+52 = 143 Average Turnaround Time = 143 / 4 =35.75 millisecond Waiting Time= Turnaround Time- Burst Time Waiting time for P0 = 31-15 = 16 P1 = 12-8 = 4 P2 = 48-25 = 23 P3 = 52-18 = 34 Total Waiting Time = 16+4+23+34 =77 Average Waiting Time = 77 / 4 =19.25 millisecond Solution 2: P0 P1 P3 P2 P0 P3 P2 P3 P2 P2 0 8 16 24 31 39 47 55 57 65 66 Turnaround time= Exit Time- Arrival Time Turnaround time for P0 = 39-0 = 39 P1 = 16-4 = 12 P2 = 66-18 = 48 P3 = 57- 5= 52 Total Turnaround Time = 39+12+48+52 = 151 Average Turnaround Time = 151 / 4 =37.75 millisecond Waiting Time= Turnaround Time- Burst Time Waiting time for P0 = 39-15 = 24 P1 = 12-8= 4 P2 = 48-25= 23 P3 = 52-18 = 34 Total Waiting Time = 24+0+5+29 = 85 Average Waiting Time = 85 / 4 =21.25 millisecond
  • CS604 Assignment 1 Solution and Discussion

    Solved cs604 assignment 1 solution discussion fall 2019
    5
    2
    0 Votes
    5 Posts
    1k Views
    zareenZ
    Solution: Q. 1 Answer: As a process executes, it changes states. The state of a process is defined in part by the current activity of that process. Given below are current and next states of process. According to your understanding, what can be condition that changes one state into another: Sr # Current State -> Next State Conditions 1 Ready->Running Scheduler Dispatch 2 Waiting->Ready I/O or Event Completion 3 Running->Terminated Exit 4 Running->Ready Interrupt 5 New->Ready Admitted Q.2 Answer: The following table contains the list of operations. Write down the Linux commands along with their screenshots for performing these operations: List of Operations List the contents of files to the terminal window. Change the owner and group owner of a file. Compares two text files and show the differences between them Print a string of text to the terminal window. Change the password for a user. You are required to run the respective commands on Ubuntu and provide relevant screen shots of the list of operations as stated in above table. Sr # List of Operations Command 1 List the contents of files to the terminal window. cat 2 Change the owner and group owner of a file. chown 3 Compares two text files and show the differences between them diff 4 Print a string of text to the terminal window. echo 5 Change the password for a user. passwd
How to Build a $1,000/Month PAK VS BAN Live Live Cricket Streaming
File Sharing

2

Online

3.0k

Users

2.8k

Topics

8.2k

Posts
| |