(a) Explain why interrupts are not appropriate for implementing synchronization primitives in multiprocessor systems (10 marks)...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
(a) Explain why interrupts are not appropriate for implementing synchronization primitives in multiprocessor systems (10 marks) (b) Race conditions are possible in many computer systems. Consider a banking system with two methods: deposit(amount) and withdraw( amount). These two methods are passed the amount that is to be deposited withdrawn from a bank account. Assume that a husband and wife share a bank account and that concurrently the husband calls the withdraw() method and the wife calls deposit(). Describe how a race condition is possible and what might be done to prevent the race condition from occurring. (10 marks) (c) Consider the following code segment: pid t pid; pid if (pid = 0) {/* child process */ fork (); thread create ( . . .); fork (); 1. How many unique processes are created? (5 marks) 2. How many unique threads are created? (5 marks) fork (); Design Assignment: Multi-level queue scheduling is used in scenarios where the processes can be classified into groups based on property like process type, CPU time, IO access, memory size, etc. In a multi-level queue scheduling, there will be 'n' number of queues, where 'n' is the number of groups the processes are classified into. Each queue will be assigned a priority and will have its own scheduling algorithm (e.g. round-robin scheduling or FCFS). For the process in a queue to execute, all the queues of priority higher than it should be empty, meaning the process in those high priority queues should have completed its execution. In this type of scheduling, once assigned to a queue, the process will not move to any other queues. Design a scheduling algorithm for this type of scheduling considering the following scenario. All the processes in the system are divided into two categories - system processes and user processes. System processes are to be given higher priority than user processes. The priority of each process ranges from 1 to 3. You may consider fixed priority scheduling for all the processes. (30 Marks) (a) Consider the example in the figure below. IDEI A P1 i) Explain how the four necessary conditions for deadlock are satisfied in this figure (3Marks) ii) We have discussed in class rules of deadlock avoidance, can you state one rule to avoid deadlock in the above figure (2Marks) R1 11 (b) (5 Marks) Consider the example of resource allocation graph in the figure below: P2 R3 COCA DOE R2 P3 d R4 P4 i) Is there a deadlock in the figure above. If yes, determine which processes and resources arevate Window participating in the deadlock. Can we resolve this deadlock by adding more resources? If yes, explain? Settings to activa If no, explain?. In both cases, determine a feasible sequence of processes to show completion. (a) Explain why interrupts are not appropriate for implementing synchronization primitives in multiprocessor systems (10 marks) (b) Race conditions are possible in many computer systems. Consider a banking system with two methods: deposit(amount) and withdraw( amount). These two methods are passed the amount that is to be deposited withdrawn from a bank account. Assume that a husband and wife share a bank account and that concurrently the husband calls the withdraw() method and the wife calls deposit(). Describe how a race condition is possible and what might be done to prevent the race condition from occurring. (10 marks) (c) Consider the following code segment: pid t pid; pid= fork (); if (pid= 0) {/* child process */ fork (); thread create ( . . .); fork (); 1. How many unique processes are created? (5 marks) 2. How many unique threads are created? (5 marks) Design Assignment: Multi-level queue scheduling is used in scenarios where the processes can be classified into groups based on property like process type, CPU time, IO access, memory size, etc. In a multi-level queue scheduling, there will be 'n' number of queues, where 'n' is the number of groups the processes are classified into. Each queue will be assigned a priority and will have its own scheduling algorithm (e.g. round-robin scheduling or FCFS). For the process in a queue to execute, all the queues of priority higher than it should be empty, meaning the process in those high priority queues should have completed its execution. In this type of scheduling, once assigned to a queue, the process will not move to any other queues. Design a scheduling algorithm for this type of scheduling considering the following scenario. All the processes in the system are divided into two categories - system processes and user processes. System processes are to be given higher priority than user processes. The priority of each process ranges from 1 to 3. You may consider fixed priority scheduling for all the processes. (30 Marks) (a) Consider the example in the figure below. IDEI A P1 i) Explain how the four necessary conditions for deadlock are satisfied in this figure (3Marks) ii) We have discussed in class rules of deadlock avoidance, can you state one rule to avoid deadlock in the above figure (2Marks) R1 11 (b) (5 Marks) Consider the example of resource allocation graph in the figure below: P2 R3 COCA DOE R2 P3 d R4 P4 i) Is there a deadlock in the figure above. If yes, determine which processes and resources arevate Window participating in the deadlock. Can we resolve this deadlock by adding more resources? If yes, explain? Settings to activa If no, explain?. In both cases, determine a feasible sequence of processes to show completion. (a) Explain why interrupts are not appropriate for implementing synchronization primitives in multiprocessor systems (10 marks) (b) Race conditions are possible in many computer systems. Consider a banking system with two methods: deposit(amount) and withdraw( amount). These two methods are passed the amount that is to be deposited withdrawn from a bank account. Assume that a husband and wife share a bank account and that concurrently the husband calls the withdraw() method and the wife calls deposit(). Describe how a race condition is possible and what might be done to prevent the race condition from occurring. (10 marks) (c) Consider the following code segment: pid t pid; pid if (pid = 0) {/* child process */ fork (); thread create ( . . .); fork (); 1. How many unique processes are created? (5 marks) 2. How many unique threads are created? (5 marks) fork (); Design Assignment: Multi-level queue scheduling is used in scenarios where the processes can be classified into groups based on property like process type, CPU time, IO access, memory size, etc. In a multi-level queue scheduling, there will be 'n' number of queues, where 'n' is the number of groups the processes are classified into. Each queue will be assigned a priority and will have its own scheduling algorithm (e.g. round-robin scheduling or FCFS). For the process in a queue to execute, all the queues of priority higher than it should be empty, meaning the process in those high priority queues should have completed its execution. In this type of scheduling, once assigned to a queue, the process will not move to any other queues. Design a scheduling algorithm for this type of scheduling considering the following scenario. All the processes in the system are divided into two categories - system processes and user processes. System processes are to be given higher priority than user processes. The priority of each process ranges from 1 to 3. You may consider fixed priority scheduling for all the processes. (30 Marks) (a) Consider the example in the figure below. IDEI A P1 i) Explain how the four necessary conditions for deadlock are satisfied in this figure (3Marks) ii) We have discussed in class rules of deadlock avoidance, can you state one rule to avoid deadlock in the above figure (2Marks) R1 11 (b) (5 Marks) Consider the example of resource allocation graph in the figure below: P2 R3 COCA DOE R2 P3 d R4 P4 i) Is there a deadlock in the figure above. If yes, determine which processes and resources arevate Window participating in the deadlock. Can we resolve this deadlock by adding more resources? If yes, explain? Settings to activa If no, explain?. In both cases, determine a feasible sequence of processes to show completion. (a) Explain why interrupts are not appropriate for implementing synchronization primitives in multiprocessor systems (10 marks) (b) Race conditions are possible in many computer systems. Consider a banking system with two methods: deposit(amount) and withdraw( amount). These two methods are passed the amount that is to be deposited withdrawn from a bank account. Assume that a husband and wife share a bank account and that concurrently the husband calls the withdraw() method and the wife calls deposit(). Describe how a race condition is possible and what might be done to prevent the race condition from occurring. (10 marks) (c) Consider the following code segment: pid t pid; pid= fork (); if (pid= 0) {/* child process */ fork (); thread create ( . . .); fork (); 1. How many unique processes are created? (5 marks) 2. How many unique threads are created? (5 marks) Design Assignment: Multi-level queue scheduling is used in scenarios where the processes can be classified into groups based on property like process type, CPU time, IO access, memory size, etc. In a multi-level queue scheduling, there will be 'n' number of queues, where 'n' is the number of groups the processes are classified into. Each queue will be assigned a priority and will have its own scheduling algorithm (e.g. round-robin scheduling or FCFS). For the process in a queue to execute, all the queues of priority higher than it should be empty, meaning the process in those high priority queues should have completed its execution. In this type of scheduling, once assigned to a queue, the process will not move to any other queues. Design a scheduling algorithm for this type of scheduling considering the following scenario. All the processes in the system are divided into two categories - system processes and user processes. System processes are to be given higher priority than user processes. The priority of each process ranges from 1 to 3. You may consider fixed priority scheduling for all the processes. (30 Marks) (a) Consider the example in the figure below. IDEI A P1 i) Explain how the four necessary conditions for deadlock are satisfied in this figure (3Marks) ii) We have discussed in class rules of deadlock avoidance, can you state one rule to avoid deadlock in the above figure (2Marks) R1 11 (b) (5 Marks) Consider the example of resource allocation graph in the figure below: P2 R3 COCA DOE R2 P3 d R4 P4 i) Is there a deadlock in the figure above. If yes, determine which processes and resources arevate Window participating in the deadlock. Can we resolve this deadlock by adding more resources? If yes, explain? Settings to activa If no, explain?. In both cases, determine a feasible sequence of processes to show completion.
Expert Answer:
Answer rating: 100% (QA)
The image you sent is a question from a computer science exam paper It asks students to explain why ... View the full answer
Related Book For
Value at Risk The New Benchmark for Managing Financial Risk
ISBN: 978-0071464956
3rd edition
Authors: Philippe Jorion
Posted Date:
Students also viewed these computer network questions
-
For a company the total defective products that were returned by customers is a function of the total units sold. The information for seven periods are presented below. Month 1 2 3 4 5 6 7 8 Unit...
-
Explain why interrupts are not appropriate for implementing synchronization primitives in multiprocessor systems.
-
Race conditions are possible in many computer systems. Consider a banking system that maintains an account balance with two functions: deposit(amount) and withdraw(amount). These two functions are...
-
4. Finally, briefly discuss how you could use an empirical econometric model to assess the health and economic growth consequences of a 'fat tax'.
-
An index is 1,200. The three-month risk-free rate is 3% per annum and the dividend yield over the next three months is 1.2% per annum. The six-month risk-free rate is 3.5% per annum and the dividend...
-
Yost-Perry Industries (YPI) manufactures a mix of affordable guitars (A. B, C) that are fabricated and assembled at four different processing stations (W, X, Y, Z). The operation is a batch process...
-
How does the auditor establish the reasonableness of the allowance for uncollectible accounts?
-
Quitmeyer Electronics Incorporated manufactures the following six microcomputer peripheral devices: internal modems, external modems, graphics circuit boards, CD drives, hard disk drives, and memory...
-
The area of a rectangle is given by 963 + 1562 +36 +28. The width of the same rectangle is given by b+2. Find the length of the rectangle. Remember, the the length times the width of a rectangle is...
-
Calculate Federal Income Tax Withholding Using Two Methods (pre-2020 Form W-4) For each employee listed, use both the wage-bracket method and the percentage method to calculate federal income tax...
-
X: f(x): Compute the first three harmonics of the Fourier series of f(x) given by the following table. 2/3 4/3 2 1.9 1.5 1.0 0 1.0 /3 1.4 1.7 5/3 1.2
-
Does it make sense for France or any other member country of the euro-zone to keep a national balance of payments? Given the single currency, do you believe that the euro-zone balance of payments is...
-
What are the differences between the Japanese keiretsu and the South Korean chaebol?
-
What is algorithmic trading?
-
What are the key barriers to investing in foreign stocks? How can they be overcome?
-
The market for peso-denominated bonds issued outside of Mexico was initiated in 2004. The peso Eurobond market began with the issuance of a MXN $3,000 MM bond by the Inter-American Development Bank...
-
A washer and dryer cost a total of $936. The cost of the washer is three times the cost of the dryer. Find the cost of each item.
-
What will be the final value of DI after executing the following piece of code? Execute the instructions dependently one after another. CLD MOU CX,OFOH MOU AX.02874H MOU DI,01000H MOU ES, DI SUB...
-
The access-control matrix could be used to determine whether a process can switch from, say, domain A to domain B and enjoy the access privileges of domain B. Is this approach equivalent to including...
-
Under what circumstances would one use the deferred procedure calls facility in Windows XP?
-
What are the implications of supporting UNIXc onsistency semantics for shared access for those files that are stored on remote file systems.
-
The Private Securities Litigation Reform Act of 1995 and the U.S. Supreme Court's decision in Central Bank of Denver v. First Interstate Bank of Denver represent major victories in the profession's...
-
What are heuristics, and why are they of concern to auditors?
-
Identify and briefly describe the major files that are typically maintained separately from audit working papers.
Study smarter with the SolutionInn App