Question

In: Computer Science

Q1. a: Why time sharing a CPU with multiple processes reduces the effectiveness of temporal locality?...

Q1. a: Why time sharing a CPU with multiple processes reduces the effectiveness of temporal locality?

b: Why time sharing a CPU with multiple processes reduces the effectiveness of spatial locality?

Q2. Why the context switching overhead need to be low for a CPU scheduler?

Solutions

Expert Solution

Answer:

1 (a) Why time sharing a CPU with multiple processes reduces the effectiveness of temporal locality?

Temporal locality is the reuse of specific data, and/or resources by the processor within a reasonably short time span. So if a process is using some resources or data and is currently running then the CPU/processor will store and fetch it from high-speed cache thus improving the speed of execution. If multiple processes are running they will be time-shared, hence the data and/or resources are constantly updated thus overall reducing the effectiveness of temporal locality.

1 (b) Why time sharing a CPU with multiple processes reduces the effectiveness of spatial locality?

Spatial locality/ data locality is the use of data elements used by the processes within comparatively close storage locations. Since we store programs in locations that are relatively close to each other. It works when data elements are stored, arranged and accessed linearly So if multiple processes are running in a time-bound fashion, they could be using different data elements, and/or resources, so the cache will be updated many times hence reducing the effectiveness of spatial locality.

2 Why the context switching overhead needs to be low for a CPU scheduler?

A context switch is a process of storing the state of a process or thread so that it can be restored and recommence execution at a later point in time. This allows a multitasking operating system to run multiple processes by sharing a single central processing unit (CPU). Storing these state values many times can be an expensive process and hence the context switch overhead should be low ideally for a CPU Scheduler.


Related Solutions

You are given the following processes with CPU-burst time, arrival time and priority (lower # means...
You are given the following processes with CPU-burst time, arrival time and priority (lower # means higher priority) Process CPU-burst Arrival time Priority P1 12 0 5 P2 6 6 2 P3 9 1 2 P4 14 3 1 P5 7 5 4 For each of the following scheduling algorithm, show (using the diagram as in the slides), how the process are being executed. Also calculate the average wait time. Shortest job first (non-preemptive) Shortest remaining job first (preemptive) Priority-based...
1. Consider the following set of processes, with the length of CPU burst and arrival time...
1. Consider the following set of processes, with the length of CPU burst and arrival time given in milliseconds.                                                              Process            Burst time       Priority            Arrival Time             P1                         10                    3                              0 P2                          1                     1                              2 P3                          2                     4                              4 P4                          5                     2                              8 a) Draw the Gantt chart that illustrates the execution of these processes using the preemptive priority scheduling algorithm (a smaller priority number implies a higher priority). b) What...
Consider the following set of processes, with the length of the CPU-burst time given in milliseconds:...
Consider the following set of processes, with the length of the CPU-burst time given in milliseconds: Process          Burst Time     P1                             5         P2                             3             P3                             1           P4                             7            P5                             4            The processes are assumed to have arrived in the order P1, P2, P3, P4, P5, all at time 0. If FCFS scheduling is used, what is the average turnaround time of these processes? Answer: Consider the following set of processes, with the length of the CPU-burst time given in milliseconds: Process          Burst Time     P1                             5         P2                             3             P3                             1           P4                             7            P5                             4           ...
Consider the following set of processes, with the length of the CPU-burst time given in milliseconds:...
Consider the following set of processes, with the length of the CPU-burst time given in milliseconds: Process Arrival Time Burst Time P1 0 5 P2 2 3 P3 3 2 P4 4 4 P5 5 3 a. Draw Gantt charts illustrating the execution of these processes using SJF pre-emptive b. What is the turnaround time of each process for each of the scheduling algorithms c. What is the waiting time of each process for each of the scheduling algorithms  
Consider the following set of processes, with the length of the CPU-burst time given in milliseconds:...
Consider the following set of processes, with the length of the CPU-burst time given in milliseconds: Process Burst Time Priority Arrival Time P1 10 3 0 P2 1 1 12 P3 2 4 0 P4 1 5 0 P5 5 2 0 In the above table, a smaller priority number implies a higher priority. Suppose that these processes are scheduled by the priority policy with preemption. Draw the Gantt chart (i.e., time chart) illustrating the execution of these processes. What...
The following table lists the characteristics of three processes that require service in a time-sharing system...
The following table lists the characteristics of three processes that require service in a time-sharing system Assume that no time is required to choose the next process and perform a context switch. For each algorithm, show the process that is running in each time interval Process Name Arrival Time Burst/CPU Time Priority Start Time End Time Turnaround (TA) Time WTA Wait P1 2 8 1 P2 4 5 4 P3 6 2 3 p4 3 4 2 d) Preemptive Shortest...
1.  Successful reproduction requires the precise coordination multiple, diverse processes in time and space. Similar to other...
1.  Successful reproduction requires the precise coordination multiple, diverse processes in time and space. Similar to other species, these diverse processes are often regulated by a single factor. A. Describe the multiple purposes and processes LH are involved in within the reproductive tract that permits the successful meeting of sperm and newly ovulated oocyte though the time the sperm is in proximity to the cumulus oophorus. B. Describe the when, where and how of the multiple critical processes calcium induces or...
Why are JIT (Just-In-Time) systems not realistic in Cuba? (Give multiple reasons)
Why are JIT (Just-In-Time) systems not realistic in Cuba? (Give multiple reasons)
Why are multiple sets of blood cultures drawn at the same time? Furthermore, what is a...
Why are multiple sets of blood cultures drawn at the same time? Furthermore, what is a good sign that a patient truly has septicemia?
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT