search
HomeCommon ProblemThe job scheduler selects jobs from the queue and puts them into operation.

Job scheduling selects jobs from the queue in the "backup" state and puts them into operation. From being handed over to the computer system to exiting the system after execution, a job generally goes through four states: submission, backup, execution and completion. The backup state means that after all the information of the job is entered into the external memory, a job control block is established for the job entering the system, and it is added to the backup job queue to wait for scheduling by the job scheduler; when the job is selected by the job scheduler, and After allocating the necessary resources and establishing a set of corresponding processes, the job enters the running state.

The job scheduler selects jobs from the queue and puts them into operation.

The operating environment of this tutorial: Windows 7 system, Dell G3 computer.

The main function of job scheduling is to review whether the system can meet the resource requirements of user jobs based on the information in the job control block, and to select certain jobs from the external storage backup queue according to a certain algorithm. memory, create processes and allocate necessary resources for them. Then insert the newly created process into the ready queue and prepare for execution. Therefore, job scheduling is sometimes called admission scheduling.

Job status

Jobs generally go through four stages from entering the system to running to completion, including entry, containment, operation, and completion. Correspondingly, a job generally goes through four states: submission, backup, execution and completion from being handed over to the computer system to exiting the system after execution.

  • Entry state: that is, the submission state, the process in which the job enters the external memory (also called the input well) from the input device; the information of the job in the submission state is entering the system.

  • Backup state: When all the information of the job is entered into the external memory, the system creates a job control block (JCB) for the job.

    After the operator inputs the job into the direct access backup accessor, he creates a job control block for the job entering the system, and adds it to the backup job queue, waiting for scheduling by the job scheduler. This process is also called job registration.

  • Running status: The job is selected by the job scheduler and the necessary resources are allocated. After a set of corresponding processes is established, the job enters the running status. It is divided into three states: ready state, execution state, and blocking state.

    A backup job is selected by the job scheduler, allocates necessary resources and enters the memory. After the job scheduler also establishes a corresponding process for it, the job changes from the backup state to the execution state.

  • Completion status: When the job ends normally or terminates due to an error, the job enters the completion phase. Generally speaking, the job scheduler needs to select the appropriate job from the queue in the standby state and put it into operation.

The steps for job scheduling are as follows:

  • (1) Establish a JCB control table based on JCB attributes and record each job a working state;

  • (2) Use the selected scheduling algorithm to select one or more jobs from the backup jobs and put them into operation;

  • (3) Make preparations for the selected job before running, including creating processes and allocating system resources to the corresponding processes:

  • (4) After the job is finished running Aftercare work. For example, status registration, resource recycling, output processing, and job cancellation.

Commonly used job scheduling algorithms

Commonly used job scheduling algorithms include first come, first served, shortest job first method, and the one with the highest response ratio first. and the precedence method.

  • (1) First come, first served (FCFS). Scheduling jobs in the order they arrive is not conducive to short jobs.

  • (2) Short jobs first (SJF). Jobs are scheduled according to their estimated running time, and jobs with a short estimated running time are scheduled first. It is not conducive to long jobs and may leave a job with a long estimated running time unserviced.

  • (3) The one with the higher response ratio takes precedence (HRN). Combining the above two, considering both the estimated running time of the job and the waiting time of the job, the response ratio is: HRN = (estimated running time waiting time) / estimated running time.

  • (4) Priority scheduling. According to the priority level of the job, the one with higher priority is scheduled first.

In addition, we need to understand several important concepts.

1. Job Turnaround Time Job turnaround time is the time between job submission and job completion. The turnaround time Ti of job i can be expressed as follows: Ti=Tei-Tsi where Tei is the completion time of job i and Tsi is the submission time of job i.

2. Average turnaround time Average turnaround time is the average of the turnaround times for multiple jobs. The average turnaround time of n jobs can be expressed by the following formula: T=(T1 T2...Tn)/n

3. Weighted turnaround time Weighted turnaround time is the ratio of job turnaround time to the actual running time of the job. The weighted turnaround time Wi of job i can be expressed as follows: Wi=Ti/Tri, where Ti is the turnaround time of job i, and Tri is the actual running time of job i.

4. Average Weighted Turnaround Time The average weighted turnaround time is the average of the weighted turnaround times for multiple operations.

For more related knowledge, please visit the FAQ column!

The above is the detailed content of The job scheduler selects jobs from the queue and puts them into operation.. For more information, please follow other related articles on the PHP Chinese website!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
deepseek web version official entrancedeepseek web version official entranceMar 12, 2025 pm 01:42 PM

The domestic AI dark horse DeepSeek has risen strongly, shocking the global AI industry! This Chinese artificial intelligence company, which has only been established for a year and a half, has won wide praise from global users for its free and open source mockups, DeepSeek-V3 and DeepSeek-R1. DeepSeek-R1 is now fully launched, with performance comparable to the official version of OpenAIo1! You can experience its powerful functions on the web page, APP and API interface. Download method: Supports iOS and Android systems, users can download it through the app store; the web version has also been officially opened! DeepSeek web version official entrance: ht

In-depth search deepseek official website entranceIn-depth search deepseek official website entranceMar 12, 2025 pm 01:33 PM

At the beginning of 2025, domestic AI "deepseek" made a stunning debut! This free and open source AI model has a performance comparable to the official version of OpenAI's o1, and has been fully launched on the web side, APP and API, supporting multi-terminal use of iOS, Android and web versions. In-depth search of deepseek official website and usage guide: official website address: https://www.deepseek.com/Using steps for web version: Click the link above to enter deepseek official website. Click the "Start Conversation" button on the homepage. For the first use, you need to log in with your mobile phone verification code. After logging in, you can enter the dialogue interface. deepseek is powerful, can write code, read file, and create code

How to solve the problem of busy servers for deepseekHow to solve the problem of busy servers for deepseekMar 12, 2025 pm 01:39 PM

DeepSeek: How to deal with the popular AI that is congested with servers? As a hot AI in 2025, DeepSeek is free and open source and has a performance comparable to the official version of OpenAIo1, which shows its popularity. However, high concurrency also brings the problem of server busyness. This article will analyze the reasons and provide coping strategies. DeepSeek web version entrance: https://www.deepseek.com/DeepSeek server busy reason: High concurrent access: DeepSeek's free and powerful features attract a large number of users to use at the same time, resulting in excessive server load. Cyber ​​Attack: It is reported that DeepSeek has an impact on the US financial industry.

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Tools

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

SublimeText3 Linux new version

SublimeText3 Linux new version

SublimeText3 Linux latest version

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft