Ask Question, Ask an Expert


Ask Operating System Expert

Basic problems:

1) Assume we have 3 processes running at the same time as shown in the following table. Each resource only has one instance.

i) Show a possible situation of resource allocation which results in deadlock. Use a resource allocation graph to show the scenario.

ii) To prevent the possibility of any deadlock, you might alter the order of getting resource requests of some process. Describe how and why. You could also use a resource allocation graph to  justify the answer.

     P1                                        P2                                      P3
while (1) {                               while (1) {                           While (1)
          get(A);                           get(D);                                get(C);
          get(B);                            get(E);                                get(F);
          get(C);                            get(B);                               get(D);
          // critical region                 // critical region                  // critical region
          // use A, B, C                     // use D, E, B                     // use C, F, D
          release(A);                           release(D);                        release(C);
          release(B);                         release(E);                         release(F);
          release(C);  }                       release(B);    }                  release(D);}

2) Consider the following snapshot of the system, answer the following problems using the banker's algorithm:

i) What is the content of the matrix Need? Is the system in a safe state?

ii) If a request from Process P1 arrives for (0,4,2,0), can the request be granted immediately?

(Please show the middle steps besides final answer)

Process    Allocation ABCD    Max ABCD    Available ABCD

P0              0 0 1 2              0 0 1 2         1 5 2 0

P1              1 0 0 0              1 7 5 0

P2              1 3 5 4              2 3 5 6

P3              0 6 3 2              0 6 5 2

P4              0 0 1 4               0 6 5 6

3) Compare contiguous-memory allocation with pure paging in the following aspects:

i) In support of dynamic memory allocation: most systems allow programs to allocate more memory to its address space during execution.  Heap and stack are exs of such allocated memory.

ii) External fragmentation and internal fragmentation.

iii) Ability to share code across processes.

4) Consider a computer system with a 32-bit logical address and 4KB page size. The system supports up to 512MB of physical memory. How many entries are there in a conventional single-level page table? How many entries are there in an inverted page table? What are the page numbers and offsets for the following address references: a) 30000, b) 256, c) 0xbcf034

5) Consider the following C program where M, N, K are predefined constants. Suppose int is 4 bytes. Assume this program is run on a machine with 4KB page size and 32 TLB entries. Firstly, TLB is empty. FIFO is used as the replacement algorithm for TLB. 
int X[N];
for (int k = 0; k < K; k++)
   for (int i = 0; i < N; i += M) 
       X[i] = random(); //generate some random number

a) If K is 1, what values of M and N will cause a TLB miss for every access of array X. describe why.

b) If K is a very large number, what values of M and N will cause TLB miss for every access of array X. describe why. 

6) Assume a logical address space is 1KB, and the page-size is 16 bytes. Suppose no page is in the main memory for this process at first and the pure demand paging is used. present free frame list is {2,5,8,1,…}.  The first frame in the free frame list would be used whenever needed. Assume TLB has two entries. Both TLB and page table are empty initially. FIFO is used as TLB replacement algorithm. Assume the following logical address is accessed in order: 0x3d,0x30,0xe5,0x7d, 0x33, 0xef. For each of the following address access:

i) State the physical address which is mapped to it.

ii) Assume it takes 10 ns to access TLB, and 100ns to access memory, and 8ms to handle page fault. How long time it takes to access this address?
(Please show the intermediate steps besides final answer)

7) Suppose there are only 4 page frames in the physical memory, for the following reference string:
 1, 2, 3, 4, 5, 3, 4, 1, 6, 7, 8, 7, 8, 9, 7, 8, 9, 5, 4, 5, 4, 2, 8.

a) What is minimum number of page faults for the optimal page replacement strategy? Please show how the page is placed and how page faults occur.

b) How many page faults occur using LRU? Please show how the page is placed and how page faults occur.

8) Consider a demand-paging system with the following time-measured utilizations:   CPU utilization: 10%, Paging disk: 98%, Other I/O devices: 5%. What does this mean? How to improve CPU utilization (Think about both hardware solutions and software solutions). Describe why.  List at least 3 possible solutions.

Operating System, Computer Science

  • Category:- Operating System
  • Reference No.:- M91143

Have any Question? 

Related Questions in Operating System

Discuss an advantage or a disadvantage of open-source

Discuss an advantage or a disadvantage of open-source operating system. 10 lines are enough.

Programming assignment lab schedulerdispatcheryou are to

Programming Assignment Lab: Scheduler/Dispatcher You are to implement a Scheduler in C, C++ and submit the source code, which we will compile and run. Both are to be delivered to the TA as source code through NYU Classes ...

Please address the followingprovide one advantage or one

Please address the following: Provide ONE advantage or ONE disadvantage of a Microkernel OS Design or a Monolithic OS Design. Provide support (back up your claims) for your view. The following are examples with proper ju ...

Coding projectcpu schedulingdesign and implement a program

Coding Project CPU Scheduling Design and implement a program that simulates a simple CPU scheduling of an operating system. Your simulator must conform to the criteria established in these specifications. 1) The simulate ...

Scripting the gnulinux shell1 write a script that stores

Scripting the GNU/Linux Shell 1. Write a script that stores the time it takes a command (your choice of command) to run in three variables, real, user, and system, corresponding to the three default times that time print ...

Outcomes1 evaluate process management techniques2 analyse

Outcomes: 1. Evaluate process management techniques. 2. Analyse different memory management strategies. 3. Become aware of the issues of operating systems in regards storage management. 4. Analyse the issues of protectio ...

Assignmentscholarly activitywindows vs mac osapples mac os

ASSIGNMENT Scholarly Activity Windows vs Mac OS Apple's Mac OS is a major competitor for Windows, and many people feel very strongly about choosing one over the other. For this assignment, locate articles online that dis ...

Problemnbspdescriptionflash back to flash forward see

Problem  Description: Flash Back to Flash Forward (see Chapter 1 Practice Exercise 1.2 and the OS in DevOps Discussion Area) While having a discussion with your OS DevOps team, you are approached with the situation: our ...

Assignment directory treein this assignment students are

Assignment: Directory Tree In this assignment, students are required to implement an operating system command that displays the tree structure of a folder or directory. The program asks the user to enter a folder name. N ...

1 write a shell script lab2q1sh to do the followingacreate

1. Write a shell script ( to do the following: a. Create list1.txt (use echo command) as: Football Basketball Skates Soccer ball Golf ball Shoes b. Create list2.txt (use echo command) as: Football Basketball S ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Section onea in an atwood machine suppose two objects of

SECTION ONE (a) In an Atwood Machine, suppose two objects of unequal mass are hung vertically over a frictionless

Part 1you work in hr for a company that operates a factory

Part 1: You work in HR for a company that operates a factory manufacturing fiberglass. There are several hundred empl

Details on advanced accounting paperthis paper is intended

DETAILS ON ADVANCED ACCOUNTING PAPER This paper is intended for students to apply the theoretical knowledge around ac

Create a provider database and related reports and queries

Create a provider database and related reports and queries to capture contact information for potential PC component pro

Describe what you learned about the impact of economic

Describe what you learned about the impact of economic, social, and demographic trends affecting the US labor environmen