In: Computer Science
Process |
Arrival Time |
Burst Time |
P1 |
0 |
7 |
P2 |
1 |
4 |
P3 |
2 |
11 |
P4 |
3 |
8 |
Use the Rate Monotonic Scheduling Algorithm to schedule these processes:
Example of Multi-level queue with feedback system:
Let us consider a framework which has a CPU bound cycle, which requires the burst season of 40 seconds.The staggered Feed Back Queue booking calculation is utilized and the queue time quantum '2' seconds and in each level it is augmented by '5' seconds.Then how frequently the cycle will be hindered and on which queue the cycle will end the execution?
Following arrangements –
Cycle P needs 40 Seconds for complete execution.
At Queue 1 it is executed for 2 seconds and afterward hindered and moved to queue 2.
At Queue 2 it is executed for 7 seconds and afterward hindered and moved to queue 3.
At Queue 3 it is executed for 12 seconds and afterward hindered and moved to queue 4.
At Queue 4 it is executed for 17 seconds and afterward hindered and moved to queue 5.
At Queue 5 it executes for 2 seconds and afterward it finishes.
So that, the cycle is intruded on multiple times and finishes on queue 5.
Aging: It is utilized to guarantee that jobs with lower need will inevitably finish their execution. This method can be utilized to decrease starvation of low priority jobs. There are numerous approaches to execute aging, yet all have a similar rule that the need of a cycle should increment as it holds up in the prepared line.
on the off chance that priority range from 127(low) to 0(high), we could expand the priority of a holding up measure by 1 Every 15 minutes. In the end even a cycle with an underlying priority of 127 would take close to 32 hours for priority 127 cycle to age to a priority-0 cycle.
Hardware Thread: It is a physical CPU or center. Thus, a 4 center CPU can truly uphold 4 hardware threads on the double - the CPU truly is completing 4 things simultaneously. One hardware thread can run numerous product threads. ... As to hardware threads, the OS attempts to plan threads to centers, if there are adequate centers.
Regarding Mutex Locks and Semaphores:
a.) Command to unlock a mutex lock
entitiled "EXCLUDE" is given as -
pthread_mutex_unlock(&EXCLUDE);
b.) Command to indicate request use of
resource controlled by semaphore named "PRINTERS" is given by
-
wait(PRINTERS);
/* this command will decrement value of semaphore PRINTERS
by 1 if it's value is greater than 0, otherwise it
waits until PRINTERS > 0 */
Gantt Chart for Scheduling the processes using Preemptive SJF:
Gantt Chart for Scheduling the processes using Non-Preemptive SJF: