Computer Science: An Overview (12th Edition)
12th Edition
ISBN: 9780133760064
Author: Glenn Brookshear, Dennis Brylow
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Expert Solution & Answer
Chapter 3.4, Problem 1QE
Explanation of Solution
Drawback to controlling access to the resource:
- The resource can be used once in a process at a time.
- The resource is allocated in a strictly alternating fashion. After the process has used and relinquished the resource, the othe...
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
A deadlock occurs when a group of processes is stalled because one process is holding a resource and waiting for another process to obtain it.
Consider the situation when two trains are approaching each other on the same track and there is only one track: once they are in front of each other, neither train can proceed. In operating systems, a similar scenario happens when two or more processes possess certain resources while waiting on resources owned by other processes (s). In the picture below, Process 1 is holding Resource 1 and waiting for Process 2 to acquire Resource 2, while Process 2 is waiting for Resource 1.
Give an example of a realistic deadlock avoidance approach and describe the basic strategy behind it.
Consider a computer system which has four identical units of a resource R. There are three processes each with a maximum claim of two units of resource R. Processes can request these resources in any way that is, two in one shot or one by one. The system always satisfies a request for a resource if enough resources are available. If the processes don't request any other kind of resource, show that the system never deadlocks?
Write a Python script that starts 3 counters using 3 new processes. All processes should be based on a single function (i.e. "counting()"). The function should take 1 parameter representing the target of the counter (i.e. if count_to=12 then the process should print 1,2,3,4...,12 ). Start each process with a different target of the counter.
How many objects does the gc track in each process before and after the counter completes its task?
Chapter 3 Solutions
Computer Science: An Overview (12th Edition)
Ch. 3.1 - Identify examples of queues. In each case,...Ch. 3.1 - Which of the following activities require...Ch. 3.1 - Prob. 3QECh. 3.1 - Prob. 4QECh. 3.2 - Prob. 1QECh. 3.2 - What is the difference between application...Ch. 3.2 - Prob. 3QECh. 3.2 - Prob. 4QECh. 3.3 - Summarize the difference between a program and a...Ch. 3.3 - Summarize the steps performed by the CPU when an...
Ch. 3.3 - Prob. 3QECh. 3.3 - If each time slice in a multiprogramming system is...Ch. 3.3 - Prob. 5QECh. 3.4 - Prob. 1QECh. 3.4 - Suppose a two-lane road converges to one lane to...Ch. 3.4 - Prob. 3QECh. 3.4 - Prob. 4QECh. 3.5 - Prob. 1QECh. 3.5 - Prob. 2QECh. 3.5 - If a process in a multiprogramming system could...Ch. 3 - List four activities of a typical operating...Ch. 3 - Summarize the distinction between batch processing...Ch. 3 - Prob. 3CRPCh. 3 - Prob. 4CRPCh. 3 - What is a multitasking operating system?Ch. 3 - Prob. 6CRPCh. 3 - On the basis of a computer system with which you...Ch. 3 - a. What is the role of the user interface of an...Ch. 3 - What directory structure is described by the path...Ch. 3 - Define the term process as it is used in the...Ch. 3 - Prob. 11CRPCh. 3 - What is the difference between a process that is...Ch. 3 - What is the difference between virtual memory and...Ch. 3 - Suppose a computer contained 512MB (MiB) of main...Ch. 3 - What complications could arise in a...Ch. 3 - What is the distinction between application...Ch. 3 - Prob. 17CRPCh. 3 - Summarize the booting process.Ch. 3 - Why is the booting process necessary?Ch. 3 - If you have a PC, record the sequence activities...Ch. 3 - Suppose a multiprogramming operating system...Ch. 3 - Prob. 22CRPCh. 3 - Prob. 23CRPCh. 3 - Prob. 24CRPCh. 3 - Prob. 25CRPCh. 3 - Would greater throughput be achieved by a system...Ch. 3 - Prob. 27CRPCh. 3 - What information is contained in the state of a...Ch. 3 - Identify a situation in a multiprogramming system...Ch. 3 - List in chronological order the major events that...Ch. 3 - Prob. 31CRPCh. 3 - Prob. 32CRPCh. 3 - Explain an important use for the test-and-set...Ch. 3 - Prob. 34CRPCh. 3 - Prob. 35CRPCh. 3 - Prob. 36CRPCh. 3 - Prob. 37CRPCh. 3 - Each of two robot arms is programmed to lift...Ch. 3 - Prob. 39CRPCh. 3 - Prob. 40CRPCh. 3 - Prob. 41CRPCh. 3 - Prob. 42CRPCh. 3 - Prob. 43CRPCh. 3 - Prob. 44CRPCh. 3 - Prob. 45CRPCh. 3 - Prob. 46CRPCh. 3 - Prob. 47CRPCh. 3 - Prob. 48CRPCh. 3 - Prob. 49CRPCh. 3 - Prob. 50CRPCh. 3 - Prob. 51CRPCh. 3 - Prob. 52CRPCh. 3 - How is the window manager related to the operating...Ch. 3 - Prob. 54CRPCh. 3 - Prob. 55CRPCh. 3 - Suppose you are using a multiuser operating system...Ch. 3 - Prob. 2SICh. 3 - Prob. 3SICh. 3 - Prob. 4SICh. 3 - Prob. 5SI
Knowledge Booster
Similar questions
- Problem Solving. Consider the code below: Shared var X: integer; {initialized to 5} Process A Process B int Y; A1: Y = X * 2; A2: X = Y int Z; B1: Z = X + 1; B2: X = Z; Question: Using a semaphore, determine the appropriate locations of wait(S) and signal(S) so that the only possible value of X is 12. choices: Place wait(S) before B1 code; and put signal(S) after A2 code. Place wait(S) before B1 code; and put signal(S) after A2 code. Place wait(S) before A1 code; and put signal(S) after B2 code. Place wait(S) before A1 code; and put signal(S) after A2 code. answer only no need explanationarrow_forwardConsider the following resource-allocation policy. Requests for and releases of resources are allowed at any time. If a request for resources cannot be satisfied because the resources are not available, then we check any processes that are blocked waiting for resources. If a blocked process has the desired resources, then these resources are taken away from it and are given to the requesting process. The vector of resources for which the blocked process is waiting is increased to include the resources that were taken away. For example, consider a system with three resource types and the vector Available initialized to (4, 2, 2). If process P0 asks for (2, 2, 1), it gets them. If P1 asks for (1, 0, 1), it gets them. Then, if P0 asks for (0, 0, 1), it is blocked (resource not available). If P2 now asks for (2, 0, 0), it gets the available one (1, 0, 0) and one that was allocated to P0 (since P0 is blocked). P0’s Allocation vector goes down to (1, 2, 1), and its Need vector goes up to (1,…arrow_forwardb) What is the contents of the Need matrix? c) Is the system in a safe state? Why? d) If a request from process P1 arrives for additional resources of (0,5,2), can the Banker's algorithm grant the request immediately?arrow_forward
- Suppose there are 8 processes in a system which are waiting to be assigned to the ready queue. The processes have the following properties. Process P1 has burst time 15, priority 6 Process P2 has burst time 12, priority 4 Process P3 has burst time 6, priority 12 Process P4 has burst time 5, priority 11 Process P5 has burst time 8, priority 9 Process P6 has burst time 9, priority 2 Process P7 has burst time 2, priority 20 Process P8 has burst time 17, priority 6 You have to use Multilevel Feedback Queue. It has three queues. The first queue takes processes with priority value from 1 to 5, the second queue takes processes with priority value of 6 to 10 and rest of the processes go to the third queue. First queue follows Round Robin Scheduling with time quantum= 4 Second queue follows Round Robin Scheduling with time quantum = 6 Third queue follows FCFC scheduling. Draw the gantt chart and calculate the average waiting time.arrow_forward73. Deadlock prevention is a set of methods : a. to ensure that at least one of the necessary conditions cannot hold b. to ensure that all of the necessary conditions do not hold c. to decide if the requested resources for a process have to be given or not d. to recover from a deadlockarrow_forwardassume a system has 6 identical resources and N processes competing for them. each process can request at most 2 resources. what is the maximum value of N for the system to be deadlock free?arrow_forward
- Consider a system consisting of m resources of the same type being shared by n processes, n > m. Each process has a maximum need of m/2 resources. Initially, each process has no resource requests. A process can request or release only one resource at a time. With n=3k and m=2k, for some integer k, show that the system is deadlock free.arrow_forwardLet the processes P1, P2, P3, and P4 be given. They arrive in the system at the same time in this order. The processes have the following service times (in time units): Process P1 P2 P3 P4 Service time (CPU burst) 53 17 68 24 For the scheduling method "Round Robin" (RR), specify the average execution time (average turnaround time) and the number of context switches. The time quantum q is set to 20 time units. You must show your calculations. You will not have to draw Gantt charts. Note: For RR, processes execute in order of their ID (i.e., P1-P2-P3-P4).arrow_forwarda) Consider the producer-consumer problem, Assume that the Consumer Process happens to run first and this process is allowed to run for about 10ms (it means that its running time can be very long). Describe what happens and explain any changes to any of the shared variables, and the flow of control (which statements in the Consumer Process execute). b) Assume that the Consumer Process is swapped out, and the Producer Process gets its chance to run, and the Producer Process is allowed to run for about 10ms (it means that its running time can be very long). Describe what happens and explain any changes to any of the shared variables, and the flow of control (which statements in the Consumer Process execute).arrow_forward
- Consider a computer with 250 MB of available memory (not used by the OS), a mouse, a keyboard, and a printer. Three programs, Job1, Job2, and Job3, are submitted for execution at 5 seconds, 10 seconds, and 20 seconds, respectively. We assume minimal processor requirements for Job1 and Job2, and continuous printer use by Job2, and keyboard and mouse use by Job1. In a simple batch environment, these jobs will be executed in sequence. Assuming Job1 completes in 10 seconds, Job2 must wait until the 10 seconds are over and then completes 15 seconds after that. Job3 begins after 30 seconds and completes at 35 seconds. Now, suppose that the jobs are run concurrently under a multiprogramming OS. The memory requirements for Job1, Job2, and Job3 are 100 Mb, 150 Mb, and 70 Mb, respectively. (a) Fill out the following table: Type of job Submission time Duration Memory required Need mouse? Need printer? Need keyboard? Job1 Job2 Job3 Processor utilization (%) Memory usage (%) Printer…arrow_forward12. In one of the deadlock prevention methods, impose a total ordering of all resource types, and require that each process requests resources in an increasing order of enumeration. This violates the _______________ condition of deadlock. a. Mutual exclusion b. Hold and Wait c. Circular Wait d. No Preemptionarrow_forward1. In a certain device, the disk rotates at 5000rpm. a) how long does one revolution take? b) what is the average rotational delay of this disk drive 2. Consider a disk dirve with 1000 tracks, numbered 0 to 999. The request queue has the following composition: 300 740 150 940 200 850 145 555 775 695. The current position is 197 and the previous request was served at 100. For each of the following disk scheduling algorithsm, compute the total distance (in tracks) that the disk arm would move. Include the calculation steps in your answers. 2.1 First - In-First-Out (FIFO) 2.2 Shortest - Service-Time - First (SSTF) 2.3 SCAN (no LOOK variation) 2.4 C-SCAN (No C-LOOK variation)arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education