3
Prepared by: TA. Latifa Alrashed 1 NET201- Principles of Information & Technology Systems Second Semester 1435/1436 H Assignment 3 Model Answer Princess Nora Bint Abdulrahman University Faculty of Computer and Information Sciences Department of Networks and Telecommunications Question 1: What is the status of a process in each of the following situations? (2.5 Points) a. The process is using the CPU. Running b. The process has finished printing and needs the attention of the CPU again. Ready c. The process has been stopped because its time slot is over. Ready d. The process is reading data from the keyboard. Waiting e. The process is printing data. Waiting Question 2: A multi-programming operating system uses virtual memory that doesn’t requires the whole program to be in physical memory during execution (NOTE: it allows swapping). The size of physical memory is 100 MB. The size of virtual memory is 1GB. (1.5 points) a. How many programs of size 10MB can be run concurrently by this operating system? Total memory = 1000 (Virtual Memory) + 100 (RAM) = 1100 MB. Number of program = 1100 / 10 = 110 Programs Question 3: Three processes (A, B, AND C) are running concurrently. Process A has acquired File1, but needs File2. Process B has acquired File3, but needs File1. Process C has acquired File2, but needs File3. (3 Points) a. Draw a diagram for these processes. [2 Points]

Assignment#3 Model answer - WordPress.com · Prepared!by:!TA.!LatifaAlrashed!! 1! NET201- Principles of Information & Technology Systems Second Semester 1435/1436 H Assignment 3 Model

  • Upload
    votu

  • View
    219

  • Download
    2

Embed Size (px)

Citation preview

Page 1: Assignment#3 Model answer - WordPress.com · Prepared!by:!TA.!LatifaAlrashed!! 1! NET201- Principles of Information & Technology Systems Second Semester 1435/1436 H Assignment 3 Model

       

Prepared  by:  TA.  Latifa  Alrashed    

1  

NET201- Principles of Information & Technology Systems Second Semester 1435/1436 H Assignment 3 Model Answer

Princess Nora Bint Abdulrahman University Faculty of Computer and Information Sciences Department of Networks and Telecommunications

Question 1: What is the status of a process in each of the following situations? (2.5 Points)

a. The process is using the CPU. Running b. The process has finished printing and needs the attention of the CPU again.

Ready c. The process has been stopped because its time slot is over. Ready d. The process is reading data from the keyboard. Waiting e. The process is printing data. Waiting  

Question 2: A multi-programming operating system uses virtual memory that doesn’t requires the whole program to be in physical memory during execution (NOTE: it allows swapping). The size of physical memory is 100 MB. The size of virtual memory is 1GB. (1.5 points)

a. How many programs of size 10MB can be run concurrently by this operating system?

Total memory = 1000 (Virtual Memory) + 100 (RAM) = 1100 MB. Number of program = 1100 / 10 = 110 Programs  

Question 3: Three processes (A, B, AND C) are running concurrently. Process A has acquired File1, but needs File2. Process B has acquired File3, but needs File1. Process C has acquired File2, but needs File3. (3 Points)

a. Draw a diagram for these processes. [2 Points]

Page 2: Assignment#3 Model answer - WordPress.com · Prepared!by:!TA.!LatifaAlrashed!! 1! NET201- Principles of Information & Technology Systems Second Semester 1435/1436 H Assignment 3 Model

       

Prepared  by:  TA.  Latifa  Alrashed    

2  

NET201- Principles of Information & Technology Systems Second Semester 1435/1436 H Assignment 3 Model Answer

Princess Nora Bint Abdulrahman University Faculty of Computer and Information Sciences Department of Networks and Telecommunications

                                     

 

 

b. Is this a deadlock situation? [1 Point] This is a deadlock situation, because all four conditions of deadlock (mutual exclusion, resource holding, no preemption, and circular waiting) are all present.

Question 4: Three processes (A, B, and C) are running concurrently. Process A has acquired File1. Process B has acquired File2, but needs File1. Process C has acquired File3, but needs File2. (3 Points)

a. Draw a diagram for these processes. [2 Points]  

Page 3: Assignment#3 Model answer - WordPress.com · Prepared!by:!TA.!LatifaAlrashed!! 1! NET201- Principles of Information & Technology Systems Second Semester 1435/1436 H Assignment 3 Model

       

Prepared  by:  TA.  Latifa  Alrashed    

3  

NET201- Principles of Information & Technology Systems Second Semester 1435/1436 H Assignment 3 Model Answer

Princess Nora Bint Abdulrahman University Faculty of Computer and Information Sciences Department of Networks and Telecommunications

     

b. Is this a deadlock situation? If your answer is “no”, show how the processes can eventually finish their tasks. [1 Point] This is not a deadlock situation, because one of the necessary conditions (circular waiting) is not present. The processes will finish in the following sequence : A -> B -> C