Processor Scheduling Model and Scheduling Algorithm in OS

Source: Internet
Author: User

Processor Scheduling Model and Scheduling Algorithm in OS
Processor Scheduling Model and Scheduling Algorithm in OS

Scheduling level

1.1. Advanced scheduling (long-range scheduling and Job Scheduling)

Function: According to an algorithm, the jobs in the backup queue in the external storage queue are transferred to the memory, and the job is the operation object.

Job: A more extensive concept than a program. It not only contains common programs and data, but also contains a statement of operation, which the system controls the operation of the program according to the statement of operation.

Operation steps: Each job can be obtained only after several independent and correlated sequential processing steps. Each step is called a job step.

Job Flow: A number of jobs are stored in the system sequentially, which forms the input Job flow.

Job control block (JCB): JCB is a symbol of the existence of a job in the system. It stores all the information required by the system for job management and scheduling. The specific content varies with the system.

Roles of Job Scheduling:

Decide how many jobs you want to accept

1.2. Intermediate Scheduling (intermediate scheduling, switch)

Function: Temporarily unable to run the process to the external storage, make it in the external storage ready state or external storage suspended state, improve the system utilization and throughput.

3. Low-Level Scheduling (short-range scheduling, process scheduling)

Function: The most basic type of scheduling, mainly used to save the field information of the processor (during process scheduling, the field information of the current process is saved first, save the on-site information to the corresponding position of the PCB of the process), select the process based on an algorithm (select the process based on the algorithm ), allocate the processor to the process (the process allocation program assigns the processor to the process ).

Basic Mechanism: Queue, dispatcher, and context switching.

Queuing device: in advance, all the ready processes in the system's ready queue are arranged into one or more queues in a certain way.

Dispatcher: extracts the process selected by the Process scheduler from the ready queue.

Context switching mechanism: Two context switches occur when the processor is switched. The system first saves the context of the current process, loads the context of the dispatch program, and finally removes the dispatch program, and loads the CPU information of the selected process into the corresponding registers.

Scheduling Method: Preemptible | non-preemptible

Non-preemptible mode: Once a processor is allocated to a process, no matter how long it takes to run, it is never allowed to preemptible the processor because of clock interruption, nor can other processes preemptible the processor that has been allocated to it. The processor will be handed over to another process unless the execution of the process ends or it is blocked for some reason.

Preemptible: allows the scheduler to pause the processes currently occupying the processor based on a certain principle and allocate the processor to other processes. (Principle: priority principle, short job (process) priority principle, and time slice principle)

Scheduling queue model and principles

2.1 scheduling Queue Model

2.1.1 scheduling Queue Model with only process scheduling:

Each process may encounter the following three situations during execution:

(1) The task has been completed in a given time slice, and the process enters the completion state after the processor is released

(2) If the task has not been completed in the time segment, the OS puts the task at the end of the ready queue;

(3) During execution, after a process is blocked due to an event, it is put into a blocking queue by the OS.
 

2.1.2 Queue Model with low-level and Advanced scheduling:

By Job Scheduling according to a certain job scheduling algorithm, select a batch of jobs from the external backup queue to be transferred to the memory, create processes for them, and send them to the ready queue, then, process scheduling selects a process according to a certain process scheduling algorithm and assigns the processor to the process.

2.1.3 Three-Level Scheduling Queue Model:

After intermediate scheduling is introduced, the process readiness status is divided into memory readiness and external memory readiness. Similarly, blocking statuses can be divided into memory congestion and external memory congestion. During scheduling, the process can be converted from memory blocking to external memory blocking. <喎?http: www.bkjia.com kf ware vc " target="_blank" class="keylink"> VcD4NCjxwPjxzdHJvbmc + signature + PC9wPg0KPHA + PGVtPjIuMi4xIMPmz/Signature + signature + M + 1zbO/Signature + xuSw/Signature + LPM1NpjcHXJz9a0 0NC1xMqxvOSjrDQmZ3Q7vfizzLXItP1JL0 + alias/fStcr9wb + alias/example/zm4bmp t/example + example Authorization + o6gyo6nP7NOmyrG85L/so7o8L3N0cm9uZz7L + authorization + vH87 + signature + sn6z + signature/qsq81rTQ0LXE1 + signature + authorization 1rix6qGjPC9wPg0KPHA + signature + O3qMqxo6y ++ B/J1/logs/Signature + 1zbPNzM3Cwb + signature + Mi4zILX3tsjL47eoPC9zdHJvbmc + PC9wPg0KPHA + PHN0cm9uZz48ZW0 + o6gxo6nPyMC0z8i3/s7xy + pushed/pushed + 06bTw9Ta1/pushed + LPMtfe2 YMqxPC9zdHJvbmc + merge + MjrttTB0NbQtcS9 + merge/merge + PHN0cm9uZz48ZW0 + merge + PC9zdHJvbmc + merge/LV3734s8yjrL2r Y/vDx7X3yOvE2rTmu/LV38rHzqrG5LfWxeS0psDtu/samples/UtcS4xMnGxr2 ++ samples + MfSzrS/vMLH1/samples/bXE1/a1vbbM1/samples + PGVtPqOoM6OpuN/Txc/IyKjTxc/release + LPMtfe2yKOstbG9 + release + LPMyrHTxc/release + LPMwODQzaOo Zaizo8 + 1zbO9 + LPMtcTTxc/large + LPMtcS99MbIs8y2yNLUvLDTw7uny/m4trfR08PAtMi3tqjTxc/large/G1w7j8usO1xLX3 Signature + signature/Signature + signature + qGjPC9wPg0KPHA + signature + o6da-o6m438/Signature + 49tf30rXS/cjrtq/Signature/fStbXE08XPyMioy + signature + PG5vYnI + 08 XPyMioPbXI Export/O3/s7xyrG85NKqx/O3/O3/export + export/export + NDQz + export + qGjPC9wPg0KPHA + export + PC9wPg0KPHA + PHN0cm9uZz67 + bG + 1K3A7aO6 PC9zdHJvbmc + z7XNs72ry/nT0LXEvs3Q9734s8ywtM/IwLTPyLf + release/release + zcHuuMO9 + LPMt8XG + release + 66y9DEtcS + release Tttptc2ztctq1mtc09c63366tcttsm/fingerprint + HGtbextcS3osn61tC2z6Oso6y9 + lpacc/fingerprint + qz/fingerprint + fingerprint/fingerprint + dDotcTKsbzkoaM8L3A + fingerprint + 4 Authorization + o6g2o6m24Ly2t7TAobbTwdC197bIy + O3qKO6PC9zdHJvbmc + PC9wPg0KPHA + authorization/authorization 1tC9 + examples/gzayjrNTa08XPyMio0/q437XEttPB0NbQo6zOqsO/uPa9 + LPMy/m55raotcTWtNDQyrG85Masvs3T + examples/Examples Pipeline + o6plans tgjqbbtwdc + + B/pipeline = "multi-level feedback queue scheduling algorithm" src = "http://www.bkjia.com/uploads/allimg/160412/0405463914-3.png" title = "" http://www.bkjia.com/ OS/"target =" _ blank "class =" keylink "> system resources.

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.