An example of preemptive priority scheduling algorithm: CPU utilization _ Preemptive priority scheduling

Source: Internet
Author: User

A multi-channel program design system is equipped with a processor and two peripherals IO1, IO2, the existing 3 priority from high to low jobs J1, J2 and J3 have been loaded into main memory, their use of resources in the order and time to occupy are:

J1:io2 (MS), CPU (10ms), IO1 (30ms), CPU (10ms).
J2:io1 (ms), CPU (20ms), IO2 (40ms)
J3:CPU (30ms), IO1 (20ms)

Processor scheduling using a preemptive priority algorithm, ignoring other auxiliary operation time, answer the following questions:
(1) Calculate the time from start to completion of the J1, J2 and J3 of jobs respectively.
(2) CPU utilization when all 3 jobs are complete.
(3) The utilization of peripheral IO1 when all 3 jobs are completed.

Analysis
As stated previously, the three processes in the multi-channel system not only compete for the use of processors, but also compete for the use of peripherals, which makes the relationship between processes more complex. On the other hand, this is entitled to highlight the process of CPU and peripherals use, weakening the processing of job scheduling, so the title has been assumed that the three processes have been loaded into main memory, from this point of view, and reduce the difficulty of the subject. The parsing process is shown in Figure 4.2 (The horizontal arrows in the figure indicate the actual execution, and the horizontal dash indicates the wait process).

Answer:
(1) from Figure 4.2:
J1 from the beginning to the completion of the time is 0~80ms
J2 from the beginning to the completion of the time is 0~90ms
J3 from the beginning to the completion of the time is 0~90ms

(2) When all three jobs are complete, the CPU utilization is:
Up = (20 + 10 + 10 + 10 + 10 + 10)/90 = 70/90 = 77.8

(3) The utilization of peripheral IO1 when all three jobs are completed are:
Uio1 = (20 + 30 + 20)/90 = 70/90 = 77.8

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.