Question

plz.
I need solving
within 1 day please

SYNCHRONIZATION or SCHEDUALING If you choose SCHEDUALING you have to do the following: define the SCHEDUALING Concept-1 discu

about algorithm we need apply on all 4 type of algorithm
and apply of two example on 4 type of algorithm
and thank you
0 0
Add a comment Improve this question Transcribed image text
Answer #1

1.The process scheduling is the activity of the process manager that handles the removal of the running process from the CPU and the selection of another process on the basis of a particular strategy.

Process scheduling is an essential part of a Multiprogramming operating systems. Such operating systems allow more than one process to be loaded into the executable memory at a time and the loaded process shares the CPU using time multiplexing.

Why do we need scheduling?
A typical process involves both I/O time and CPU time. In a uni programming system like MS-DOS, time spent waiting for I/O is wasted and CPU is free during this time. In multi programming systems, one process can use CPU while another is waiting for I/O. This is possible only with process scheduling.

Objectives of Process Scheduling Algorithm

Max CPU utilization [Keep CPU as busy as possible]
Fair allocation of CPU.
Max throughput [Number of processes that complete their execution per time unit]
Min turnaround time [Time taken by a process to finish execution]
Min waiting time [Time a process waits in ready queue]
Min response time [Time when a process produces first response]

Objectives of Process Scheduling Algorithm

Max CPU utilization [Keep CPU as busy as possible]
Fair allocation of CPU.
Max throughput [Number of processes that complete their execution per time unit]
Min turnaround time [Time taken by a process to finish execution]
Min waiting time [Time a process waits in ready queue]
Min response time [Time when a process produces first response]

Process Scheduling Queues

The OS maintains all PCBs in Process Scheduling Queues. The OS maintains a separate queue for each of the process states and PCBs of all processes in the same execution state are placed in the same queue. When the state of a process is changed, its PCB is unlinked from its current queue and moved to its new state queue.

The Operating System maintains the following important process scheduling queues −

  • Job queue − This queue keeps all the processes in the system.

  • Ready queue − This queue keeps a set of all processes residing in main memory, ready and waiting to execute. A new process is always put in this queue.

  • Device queues − The processes which are blocked due to unavailability of an I/O device constitute this queue.

Job queue Ready crueue (CPU) Exit Tlok o waiting - 1 Queue a

Different Scheduling Algorithms

First Come First Serve (FCFS): Simplest scheduling algorithm that schedules according to arrival times of processes. First come first serve scheduling algorithm states that the process that requests the CPU first is allocated the CPU first. It is implemented by using the FIFO queue. When a process enters the ready queue, its PCB is linked onto the tail of the queue. When the CPU is free, it is allocated to the process at the head of the queue. The running process is then removed from the queue. FCFS is a non-preemptive scheduling algorithm.

Note:First come first serve suffers from convoy effect.

Convoy Effect is a situation where many processes, who need to use a resource for short time are blocked by one process holding that resource for a long time.

This essentially leads to poort utilization of resources and hence poor performance.

Advantages:

  • FCFS algorithm doesn't include any complex logic, it just puts the process requests in a queue and executes it one by one.
  • Hence, FCFS is pretty simple and easy to implement.
  • Eventually, every process will get a chance to run, so starvation doesn't occur.

Disadvantages:

  • There is no option for pre-emption of a process. If a process is started, then CPU executes the process until it ends.
  • Because there is no pre-emption, if a process executes for a long time, the processes in the back of the queue will have to wait for a long time before they get a chance to be executed.

Shortest Job First (SJF NON-preemptive): Process which have the shortest burst time are scheduled first.If two processes have the same bust time then FCFS is used to break the tie. It is a non-preemptive scheduling algorithm.

Shortest Remaining Time First (SRTF preemptive SJF): It is preemptive mode of SJF algorithm in which jobs are schedule according to shortest remaining time.

Advantages: of Shortest Job First scheduling algorithm.

  • According to the definition, short processes are executed first and then followed by longer processes.
  • The throughput is increased because more processes can be executed in less amount of time.

And the Disadvantages:

  • The time taken by a process must be known by the CPU beforehand, which is not possible.
  • Longer processes will have more waiting time, eventually they'll suffer starvation.

Note: Preemptive Shortest Job First(SRTF) scheduling will have the same advantages and disadvantages as those for SJF.

Round Robin Scheduling:

  • A fixed time is allotted to each process, called quantum, for execution.
  • Once a process is executed for given time period that process is preemptied and other process executes for given time period.
  • Context switching is used to save states of preemptied processes.

Each process is assigned a fixed time(Time Quantum/Time Slice) in cyclic way.It is designed especially for the time-sharing system. The ready queue is treated as a circular queue. The CPU scheduler goes around the ready queue, allocating the CPU to each process for a time interval of up to 1-time quantum. To implement Round Robin scheduling, we keep the ready queue as a FIFO queue of processes. New processes are added to the tail of the ready queue. The CPU scheduler picks the first process from the ready queue, sets a timer to interrupt after 1-time quantum, and dispatches the process. One of two things will then happen. The process may have a CPU burst of less than 1-time quantum. In this case, the process itself will release the CPU voluntarily. The scheduler will then proceed to the next process in the ready queue. Otherwise, if the CPU burst of the currently running process is longer than 1-time quantum, the timer will go off and will cause an interrupt to the operating system. A context switch will be executed, and the process will be put at the tail of the ready queue. The CPU scheduler will then select the next process in the ready queue.

Advantages: of using the Round Robin Scheduling:

  • Each process is served by the CPU for a fixed time quantum, so all processes are given the same priority.
  • Starvation doesn't occur because for each round robin cycle, every process is given a fixed time to execute. No process is left behind.

Disadvantages:

  • The throughput in RR largely depends on the choice of the length of the time quantum. If time quantum is longer than needed, it tends to exhibit the same behavior as FCFS.
  • If time quantum is shorter than needed, the number of times that CPU switches from one process to another process, increases. This leads to decrease in CPU efficiency.

Priority Based scheduling (Non-Preemptive): In this scheduling, processes are scheduled according to their priorities, i.e., highest priority process is scheduled first. If priorities of two processes match, then schedule according to arrival time. Here starvation of process is possible.

Problem with Priority Scheduling Algorithm

In priority scheduling algorithm, the chances of indefinite blocking or starvation.

A process is considered blocked when it is ready to run but has to wait for the CPU as some other process is running currently.

But in case of priority scheduling if new higher priority processes keeps coming in the ready queue then the processes waiting in the ready queue with lower priority may have to wait for long durations before getting the CPU for execution.

Using Aging Technique with Priority Scheduling

To prevent starvation of any process, we can use the concept of aging where we keep on increasing the priority of low-priority process based on the its waiting time.

For example, if we decide the aging factor to be 0.5 for each day of waiting, then if a process with priority 20(which is comparitively low priority) comes in the ready queue. After one day of waiting, its priority is increased to 19.5 and so on.

Doing so, we can ensure that no process will have to wait for indefinite time for getting CPU time for processing.

Advantages of Priority Scheduling:

  • The priority of a process can be selected based on memory requirement, time requirement or user preference. For example, a high end game will have better graphics, that means the process which updates the screen in a game will have higher priority so as to achieve better graphics performance.

Some Disadvantages:

  • A second scheduling algorithm is required to schedule the processes which have same priority.
  • In preemptive priority scheduling, a higher priority process can execute ahead of an already executing lower priority process. If lower priority process keeps waiting for higher priority processes, starvation occurs.

examples:

1. FC FS Burst Time Time Process Arrival 21 P 24 o The 2 24 30 32 aug. waiting time (WT) = 0 +21+24+30 18.75Shortest Job First ( Non-Preemptive) Process Burst Time Arrival Time Pn 2 L 3.2 Aug. Waiting Time will be= (0 +² +5+11/4 = 4,Page No. Priority Process Schauling Algorithm I Burst Time Pricerity 32 RIP Rih o 3 24 26 Aug waiting Time: 0+3+2 4+2614 = 13

Add a comment
Know the answer?
Add Answer to:
plz. I need solving within 1 day please about algorithm we need apply on all 4...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • I need the report like this (idea) *Sorting Algorithms: A sorting algorithm is an algorithm that...

    I need the report like this (idea) *Sorting Algorithms: A sorting algorithm is an algorithm that puts elements of a list in a certain order. The most-used orders are numerical order and lexicographical order. Efficient sorting is important for optimizing the use of other algorithms (such as search and merge algorithms) which require input data to be in sorted lists; it is also often useful for canonical zing data and for producing human-readable output. More formally, the output must satisfy...

  • Need the process that how we get P2 P1 P4 P3 and waiting time please 1....

    Need the process that how we get P2 P1 P4 P3 and waiting time please 1. Draw a Gantt chart below similar to the ones from lecture that illustrates the execution of the processes using the shortest-job-first CPU scheduling algorithm. Process Arrival Burst | Time Time P. 7 ms 2 ms | P2 Oms 8 ms 11 ms 5 ms P4 4 ms 9 ms P2 P2 P4 P3 oms 8 10 19 24 | Using the chart you drew,...

  • please solve all the questions . i need them urgently 1. Explain the concept of an...

    please solve all the questions . i need them urgently 1. Explain the concept of an initial-value problem for a differential equation (You may use examples to support your answer). 2. Find an example of a boundary value problem for a partial differential equation (you can write this in the same formas described in the lecture notes) 3. Consider the following equation: som AS (a) Identify the equation (by name). (b) Identify the variables in the equation: f and t....

  • Define and provide examples of the following concepts: Environment, ecosystem, abiotic and biotic factors, natural and...

    Define and provide examples of the following concepts: Environment, ecosystem, abiotic and biotic factors, natural and experimental boundaries, flows of matter and energy. 
 Explain how the boundaries of an ecosystem may differ from those like national parks, county, state or national borders. Explain how natural features of the landscape (ex: a watershed) or biological phenomena (ex: a species range) can be used to define the boundaries of an ecosystem. 
 Explain how ecosystems vary in size and scale, and how some...

  • I NEED ONLY NUMBER ONE 1 ASAP, THANK YOU! Only define them not spell. 1. Define...

    I NEED ONLY NUMBER ONE 1 ASAP, THANK YOU! Only define them not spell. 1. Define and spell the key terms os presented in the glossary 2. Define terminology necessary to understand and code medical insurance com for 3. Describe how to use the most current procedural and diagnostic coding systems 4. Code a sample claim form. 5. Apply third-party guidelines 6. Recognize common errors in completing insurance claim forms. 7. Explain the difference between the CMS-1500 (02-12) and the...

  • Please help! I need help finding and solving equations of equilibrium to find the max tension in ...

    please help! I need help finding and solving equations of equilibrium to find the max tension in the cables and the angle that results in the maximum tension, I also have pictures below of the work I have so far all I really need is equations for the 4 cable part and that's it but I put the whole assignment so you could see thanks! Tower Support System Challenge Challenge Scenario: Due to weather conditions, a major communication tower n...

  • Please help, I need 3 to 4 sentences each for questions 1-4. When answering, please use...

    Please help, I need 3 to 4 sentences each for questions 1-4. When answering, please use a scientific writing style as it states in the discussion section. Chemical reaction equations Lab 1. KHC8H404(aq) + NaOH(aq) + H20 (1) + NaKC8H404(aq) Lab 2. HCH3CO2(aq) + NaOH(aq) → H20(1) + NaCH3CO2 (aq) (Eq 1) (Eq 2) Results Brand of vinegar analyzed in Lab 2: Great Value Amount of acetic acid in the vinegar claimed on the label: 5 % acidity Name of...

  • i need answer of questions from 11 to 30 1. Define manufacturing and list major manufacturing processes that are emp...

    i need answer of questions from 11 to 30 1. Define manufacturing and list major manufacturing processes that are employed to manufacture the engineering materials 2. Why it is important to provide venting system for the escape of gases from the mold cavity? 3. What type of problems/defects can occur if mold material provides too much restraint to a solidifying and cooling liquid? 4. Sketch a gating system that is employed to manufacture metallic castings? 5. What is a draft...

  • Step One This is the Measurable interface we saw in class; you will need to provide...

    Step One This is the Measurable interface we saw in class; you will need to provide this class; this is it in its entirety (this is literally all you have to do for this step): public interface Measurable double getMeasure(); Step Two This is the Comparable interface that is a part of the standard Java library: public interface Comparable int compareTo (Object otherObject); Finish this class to represent a PiggyBank. A PiggyBank holds quarters, dimes, nickels, and pennies. You will...

  • scheduling program in C, please help 1 Objectives This programming project is to simulate a few...

    scheduling program in C, please help 1 Objectives This programming project is to simulate a few CPU scheduling policies discussed in the class. You will write a C program to implement a simulator with different scheduling algorithms. The simulator selects a task to run from ready queue based on the scheduling algorithm. Since the project intends to simulate a CPU scheduler, so it does not require any actual process creation or execution. When a task is scheduled, the simulator will...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT