Status and transitions of processes

Source: Internet
Author: User

Processes typically have the following three states during their life cycle:

1) Running status: The process is running on the processing machine. In a single processor environment, at most one process at a time is in the running state.

2) Ready state: The process is already in the ready state, that is, the process obtains all the required resources except the processor, which can be run once the processing machine is available.

3) Blocking state, also known as wait status: The process is waiting for an event to pause, such as waiting for a resource to be available (excluding processors) or waiting for input/output to complete. Even if the processor is idle, the process cannot run.

Note the difference between the ready state and the wait state: the readiness State means that the process is only missing processors and executes as soon as the processor resources are obtained, while the wait state refers to the process needing additional resources (except the processor) or waiting for an event. The reason for dividing the processor and other resources is because in the time-slice rotation mechanism of the timeshare system, the time slices divided by each process are several milliseconds. In other words, the process gets the processor time is very short and very frequent, the process in the process is actually frequently converted to the ready state, while other resources (such as peripherals) use and allocation or the occurrence of an event (such as the completion of I/O operations) corresponds to a relatively long time, The number of transitions to the wait state is also relatively small. In this view, the readiness and wait states are two completely different states in the process life cycle and need to be differentiated.

Ready status, running state: When the process in the ready state is dispatched, the processor resource (dispatch processor Time slice) is obtained, and the process is converted from ready to run state.

Run status-ready state: The running process will have to give up the processor after the time slice is exhausted, thus converting the process from the running state to the ready state. Also, in a stripped-down operating system, when a higher-priority process is in place, the level of dispatch translates the process being executed into a ready state for higher-priority processes to execute.

Blocking state: When a process requests the use and allocation of a resource (such as a peripheral) or waits for an event to occur (such as the completion of an I/O operation), it transitions from the running state to the blocking state. The process requests the operating system to provide services in the form of a system call, which is a special form of invoking the operating system kernel procedure by the running user-state program.

Blocking status-ready state: When a process waits for an event to arrive, such as the end of an I/O operation or the end of an interrupt, the interrupt handler must convert the state of the corresponding process from a blocking state to a ready state.

Status and transitions of processes

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.