(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'.
-
Firms operating at or near capacity are unlikely to instigate price wars. Briefly explain.
-
The auditors for Weston University are conducting their audit for the fiscal year ended December 31, 2015. Specifically, the audit firm is now focusing on the audit of revenue from this season's home...
-
What is the starting point for calculating the cash flow from operating activities?
-
1. What conditions appear to have allowed the Parmalat situation to get out of control? 2. What specific audit procedures could have uncovered the Parmalat fraud earlier? 3. What audit steps should...
-
Can you think of real-world scenarios or research studies where the Chi-square distribution and associated Chi-square tests might be more appropriate and informative than other statistical methods,...
-
Play the following games in the Games Fair: Three Prize Roller Word Scramble Marble Draw Ten Spinner For each Games Fair game, answer the following questions: Create the probability distribution in a...
-
Zotee Sdn Bhd is incorporated on 1st August 1995. The Board of Directors is made up of Zo, Ah Tee and Zotee. Zotee Sdn Bhd created a fixed charge over a piece of land it owns in favour of Bank DEF on...
-
Allan, an American senior manager in his late 40s, was heading the operations department of A2Z Advertising Company in New York, when the company acquired a German-based advertising company Schumark...
-
Knowledge Check 01 Cleaning equipment was used by Cary's Carpet Cleaning, Inc. in April to generate revenues. The company estimates $2,400 of depreciation each year. Complete the necessary adjustment...
-
Robin's contracting creates individual pieces of interior design for clients. Each is different as they have different requirements and stylizing. Revenue for below for a wedding is $50,000 cash upon...
-
Prince Edward Island-based coffee roaster and caf, had found success since opening in 2012. Co-owner Colleen Mackay and her partners were trying to grow the wholesale side of the business, selling...
-
Required: Using the information below, prepare a multi-step income statement for the year ended December 31, 2025, for Campbell Corporation. Management policy is to create a separate other...
-
Projected cash flows for the mutually exclusive Projects A and B are shown below.. 0 A -$12,500 1 $5,100 2 3 $5,350 $5,550 B 0 1 2 3 -$12,500 $5,500 $5,300 $5,150 1. What is the IRR of each project?...
-
The May 2014 revenue and cost information for Houston Outfitters, Inc. follow: Sales Revenue (at standard).............. $ 540,000 Cost of Goods Sold (at standard) ..........341,000 Direct Materials...
-
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.
-
To provide a simplified calculation method for the variable flow rate leaching problem solved in Example 14-2, your boss asks you to force-fit the problem so that a Kremser equation solution can be...
-
Experimental data for leaching sugar from sugarcane with water show that a reasonable value for effective equilibrium constant \(y / x=m_{E}\) is 1.18 where \(\mathrm{y}\) and \(\mathrm{x}\) are the...
-
A countercurrent leaching system is recovering oil from soybeans with five stages. On a volumetric basis, liquid flow rate/solids flow rate \(=1.36\). Recovery of oil in the solvent is \(97.5 \%\)....
Study smarter with the SolutionInn App