answersLogoWhite

0


Best Answer

On each system clock tick, at interval set by design...

  • If no other runnable threads, return from clock interrupt.
  • Save the currently running thread's context.
  • Restore the next runnable thread's context.
  • Return from clock tick interrupt.

Note: Most modern schedulers combine round-robin with priority. In the priority scheme, any runnable thread with a higher priority than the interrupted thread takes precedence. If there are none, then round-robin applies at the current priority. If there are no runnable threads at the current priority, lower priorities are considered until we reach the idle priority thread, which, by the way, is always runnable.

Also, there is usually an algorithm that adjusts thread priority dynamically. As the thread runs, if it stays runnable its priority slowly drops from its initial base priority. If it is constantly blocking and then then becoming runnable, its priority increases, often faster than it decreases. This makes interactive threads appear to be very responsive, while CPU intensive threads slowly defer to interactive threads. This is usually a good compromise between responsiveness and throughput.

User Avatar

Wiki User

12y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Write an algorithm for Round Robin CPU scheduling using?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Write an algorithm for round robin?

A round robin algorithm processes a number of tasks, steps or items one by one in a cyclic fashion like so:1. For N items, n=0, 2, 3, ..., N-1, let nbe 0.2. Process step (item, task) n3. Compute n = (n+1) % N, where % is the modulo operator (the remainder of integer division)4. Proceed to step 2.


What is algorithm to write algorithm to the program to access a pointer variable in structure?

Here is the algorithm of the algorithm to write an algorithm to access a pointer in a variable. Algorithmically.name_of_the_structure dot name_of_the _field,eg:mystruct.pointerfield


Write an algorithm to find the root of quadratic equation?

Write an algorithm to find the root of quadratic equation


A Write the algorithm to concatenate two given strings?

a write the algorithm to concatenate two given string


How does one write an algorithm that rounds off a decimal point to the nearest integer?

double round (double x) return (int) x + 0.5;


Explain with an example first come first serve scheduling algorithm?

By far the simplest CPU-scheduling algorithm is the first-come, first-served (FCFS) scheduling algorithm. With this scheme, the process that requests the CPU first is allocated the CPU first. The implementation of the FCFS policy is easily managed with a 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. The code for FCFS scheduling is simple to write and understand. The average waiting time under the FCFS policy, however, is often quite long. Consider the following set of processes that arrive at time 0, with the length of the CPU-burst time given in milliseconds:


How do you write an Algorithm for a C plus plus Program?

You don't write an algorithm for a C++ program, unless you are documenting the C++ program after-the-fact. The normal procedure is to write the algorithm first, in a language independent fashion, and then translate that stated algorithm into C++ code, or into whatever language you wish.


Write an algorithm and draw flowchart to calculate the perimeter of a square?

write an algorithm and draw a flow chart to find perimeter of a square


Design step by steps algorithm on how to write the letter A and display the result?

Design step by steps algorithm on how to write the letter A and display the result


Write an algorithm to check whether a number is a prime number or not?

You can write out this algorithm. This will then be programmed into the device to make determining prime numbers easier.


What is algorithm write properties of algorithm?

An ALGORITHM is a sequence of steps that depicts the program logic independent of the language in which it is to be implemented. An algorithm should be designed with space and time complexities in mind.


How do you write a structured algorithm an a flowchart to calculate and the average of ten scores?

how to write a structured algorithm that input the name and price of an item and quantity and amount