1nbspassume we have three processes running at the same

Assignment Help Operating System
Reference no: EM13350984

1) Assume we have three 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 questions 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 examples 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. Explain 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. Explain 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?

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. Describe why.  List at least 3 possible solutions.

Reference no: EM13350984

Questions Cloud

Evaluating value of long-term elements of capital : evaluating value of long-term elements of capital structureassignmentyou are interested in suggesting a new venture to
A gold mine has just completed mining waste pre-strip prior : a gold mine has just completed mining waste pre-strip prior to commencing grade control mining. the waste rock was
Coal-fired power generationcompared with other fossil fuels : coal-fired power generationcompared with other fossil fuels flaming coal produces relatively large amounts of
Jane stevens is 30 years old and she is reviewing her : jane stevens is 30 years old and she is reviewing her retirement plans. she at present has 20000 in a retirement
1nbspassume we have three processes running at the same : 1nbspassume we have three processes running at the same time as shown in the following table. each resource only has
Q1outline and show the way in which the law of hearsay : q1outline and show the way in which the law of hearsay might affect the admissibility in court of computer-generated
Q1explain and discuss the problems presented by electronic : q1explain and discuss the problems presented by electronic discovery in civil actions and how the law has
What legal issues are shown by large scale data breaches : what legal issues are shown by large scale data breaches and how should the law respond? answers should crucially
Question 1 analyzing a existing om techniquefind out one : question 1 analyzing a existing om techniquefind out one scholarly journal article reporting on one or more of the

Reviews

Write a Review

Operating System Questions & Answers

  Pros and cons of using embedded uid and pw

Think about an embedded user id and password which provides me access to a client/server environment. Discuss the pros and cons of using an embedded uid and pw?

  Determine the rang of usable ip addresses

Determine the rang of usable IP addresses for the following IP subnet also determine the bradcast address for the subnet?

  Disk scheduling algorithm

Simulation of Elevator and Shortest Seek Time First

  Operating system maps user-level threads to kernel

Suppose an operating system maps user-level threads to the kernel using the many-to-many model and the mapping is done through LWPs.

  Deadlock avoidance and scheduling

Deadlock Avoidance and Scheduling

  Efficiency and effectiveness of project communications

Determine what types of data are shared through documents and what types are shared through meetings? Discuss how has social networking affected the efficiency and effectiveness of project communications?

  Question about vpn communications

Discuss how routers and firewalls and IDSs inspect inbound and outbound traffic and explain how we use those features to our benefits in securing the network.

  Access time for reading a word from a virtual address

Consider a computer system where the overhead required for reading a word from the page table is 1.25ms. A TLB lookup of a word requires 250 ns.

  Write the start-up steps in windows nt

Write the start-up steps in Windows NT. Provide estimate for the capital investment needed in computer forensics for a 2,000,000 population.

  Discussion on dns for internet operations

Discuss how do you think the DNS is important for internet operations and what would happen if the DNS of your company/orgnization or your provider or root DNS fails?

  The state of the waiting thread to blocked

Which IPC mechanism does not change the state of the waiting thread to blocked?

  A current implementation of a particular multicore

A current implementation of a particular multicore processor has a 64KB Level one cache for each core, 256KB Level two, and 6MB for level three.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd