Processor Scheduling
3.1 level of processor scheduling 3.11 Advanced Scheduling , also known as job scheduling or long-range scheduling, calls those jobs in the fallback queue in external memory into memory.
Job: It not only contains the usual procedures and data, but also should be equipped with a job description, the system according to the operating instructions for the operation of the program control, in the batch processing system, the basic unit of operations from the external memory into memory.
Job Step:
A typical job is divided into three job steps: Compile, connect assembly, run
Job control block: JCB, which holds all the information the system needs to schedule and manage jobs.
3.12 Low-level scheduling is also known as "process scheduling" or "short-range scheduling", his object is the process (or kernel process).
The function of low-level dispatching: (1) The field information of the storage processor
(2) Select a process according to an algorithm
(3) Assigning the processor to the process
Three basic mechanisms of process scheduling: queueing, dispatcher, context switching mechanism
How the process is dispatched:
(1) Non-preemptive mode: Once the processor is assigned to the process, it keeps him running until the process is over or some time is blocked.
(2) preemption mode: Allows the scheduler to suspend an ongoing process according to a certain principle, but based on a certain principle of priority principle, short-term (process) priority principle, time slice principle.
3.13 Intermediate SchedulingAlso known as "medium-range scheduling", the main purpose is to improve memory utilization and system throughput. Some temporarily unable to run processes are no longer consuming valuable memory resources, and they are transferred to the external memory to wait, at this time the process state
becomes ready to be stored or suspended. When these processes are heavy with running conditions and the memory is slightly idle, it is up to the intermediate scheduling to determine which of the ready processes on the external memory are re-transferred into memory.
3.2 Scheduling queue model and scheduling criteria 3.21 Scheduling Queue Model1 scheduling queue model with process scheduling only: The Ready queue is a FIFO queue. The task is placed at the end of the blocking queue after the time slice is incomplete or blocked, and the queue is blocked when the next time slice arrives or the event appears
The team first process in the ready queue at the end.
2 scheduling queue model with advanced and low-level scheduling
Note Two points: one, the ready queue is the priority queue, the process is inserted into the queue according to its priority in the entry to the corresponding location.
Two, set up multiple blocking queues, each corresponding to a process blocking event.
3 scheduling queue model with three-level scheduling
Ready states are memory-ready and external memory ready. The intermediate schedule is to turn external memory ready into memory ready.
3.22 Selection of scheduling methods and some criteria for scheduling algorithms1 User-oriented guidelines: Short turnaround time, response time block, deadline guarantee, priority criteria.
Deadline refers to the latest time a task must start executing. Or the latest time that must be completed.
2 system-oriented guidelines: High system throughput, good utilization of processor, balance of resources and utilization
3.3 Scheduling algorithmAccording to the resource allocation algorithm stipulated by the system's resource allocation policy, different scheduling algorithms are usually used for different system and system targets.
3.31 first come first service and short job (process) priority scheduling algorithmFirst come first service scheduling algorithm: FCFS, each schedule from the back queue to pick one or more jobs first into the queue, they are transferred into memory.
Short job priority scheduling algorithm: SJF, the algorithm for short or short process priority.
3.32 High priority first scheduling algorithmThe type of priority scheduling algorithm: Non-preemptive priority algorithm and preemptive priority algorithm.
Type of priority:
(1) Static priority: the creation process is the decision, the entire operation period does not change.
Identify three aspects of process prioritization: process type, process-to-resource requirements, and user requirements.
(2) Dynamic priority:
Priority is given when the process is created, but it can be changed as the process advances or the waiting time increases.
High response ratio priority scheduling algorithm: Priority equals response than Rp.
Rp = (wait time + request service time)/Request Service time = response Time/request service time;
The algorithm not only takes care of short work, but takes into account the order of arrival of the work.
3.33 Time-slice-based rotation scheduling algorithmTime Slice Rotation method:
Basic principle: The system will all the ready processes in the first-come-first-served order in a queue, each time the scheduling, the CPU allocated to the first team process, and let it execute a time slice, the time slice run out then stop the process, send it to the end of the team, continue to cycle.
The time slice is ok: a more desirable size is that the time slice is slightly larger than the time required for a typical interaction, so that most processes can be done within a single time slice.
Multilevel feedback queue scheduling algorithm:
(1) Set up multiple ready queues, assigning different priorities to each queue, and the smaller the allocated time slices with higher priority levels.
(2) When a new process enters memory, it first puts him at the end of the first queue and waits in line with the principle of FCFS-Come-Serve. Evacuation system when it is time for the process to execute, as if he can complete the
Otherwise, at the end of the first time slice, he is transferred to the end of the second queue, which executes in a loop.
(3) Only when the first queue is idle, the scheduler dispatches the processes in the second queue to run. If the processor is serving a process in the I queue, and a new process enters the queue with high priority, the new process seizes the running process processor.
3.4 Real-time scheduling 3.41 Basic conditions for real-time scheduling(1) Provide necessary information: Ready time, start deadline and completion deadline, processing time, resource requirement, priority
(2) The system processing time is strong: If the processor capacity is not strong enough, it may be because the processor is too busy to make certain real-time tasks can not be processed in a timely manner resulting in unpredictable consequences.
(3) using preemptive scheduling mechanism
(4) with fast switching mechanism
3.42 Classification of real-time scheduling algorithmsNon-preemptive scheduling algorithm:
(1) Non-preemptive rotary scheduling algorithm
(2) Non-preemptive priority scheduling algorithm
Preemptive Scheduling algorithm:
(1) Preemptive priority scheduling algorithm based on clock interrupt: When the high-priority task arrives, it does not immediately preempt the current task processor, waiting for the clock to come back to preempt.
(2) Immediate preemption priority scheduling algorithm: As long as the current task is not in the critical section, immediately deprived of the current task execution, the processor allocated to the request to interrupt more urgent tasks.
3.43 Typical real-time scheduling algorithms(1) The earliest deadline is EDF (earlist Deadline first)
Non-preemptive scheduling method for scheduling real-time tasks, preemptive scheduling for periodic real-time tasks
(2) Minimum relaxation priority is LLF (Least laxity first) algorithm
Prioritize tasks based on task urgency (slack) level