Operating system--process status and transformation _ operating system

Source: Internet
Author: User

1. Why separate ready and blocking states

A: Because the ready state only needs to wait for the processor, and the blocking state may be waiting for input and output, even if the processor is allocated in vain, so the two state diagram is inappropriate. For the scheduling process, you only need to wait for the process in the ready queue, because the blocking state can be converted to the ready queue.

2. Process five states

1 new state: The process has been created but not accepted by the OS as an executable process. (no corresponding resources have been requested).

2 Ready state: The process is ready, ready to execute (only waiting for the processor).

3 Execution Status: The process is being executed (single processor, at a time only one process occupies a processor).

4 Blocking state: Wait for an event to occur to perform, such as Waiting for I/O to complete.

5) Termination status.

3. Problem: Multiple processes compete for memory resources

L Memory Resource Tight

L no-ready queue, processor idle: I/O speed is much slower than processor speed, may occur all process blocking wait I/O.

Solving method

L Exchange Technology: a part of the temporarily unable to run the process (blocking the process) to the external memory (only the program and data, the PCB does not change out), to make room for space, can invoke a new process to execute.

• Virtual Storage technology: Each process can only load part of the program and data

4. Suspend: The process is exchanged to the external memory, the state becomes suspended state

4.1 Cause of Process suspend (P91)

L Process all blocked, processor idle.

L system overload, memory space is tight. (Let other processes finish first)

L The needs of the operating system. The operating system may need to suspend the background process or some service processes, or some of the processes that may be causing the failure.

L End user requests.

• The needs of the parent process.

4.2 Characteristics of the suspend process

L Cannot execute immediately

L may be waiting for an event to occur, and if so, the blocking condition is independent of the suspend condition, and the process cannot execute even if the blocking event occurs.

N blocking and suspending are not associated.

n if the a process now requires input data, at this point a process is a blocking state, you may select the blocking process (a process) when you choose to suspend the process, at which point a process hangs, entering data, entering into the memory buffer. When the data has been lost, send command data to the processor has been entered completed, blocking the event to be lifted, but in fact still hangs, so it is still suspended state.

L The process to suspend is: itself, the parent process, the OS.

L ONLY the process that suspends it can convert it from a pending state to another state.

4.3 Blocking and suspending

L Process Wait Time: blocked or not.

L The process is swapped out of memory: hangs or not.

4.4 Four State combinations

L Ready: Process in memory, ready to execute.

L Blocking: Process in memory, waiting for event.

L Ready/Suspend: The process is out of existence and can be executed as long as it is transferred into memory.

L Blocking/suspending: The process is out of existence, waiting for events.

4.5 processor can be scheduled to execute the process of two kinds

• Newly created processes

L or swap in a previously suspended process

Typically, to avoid increased system load, the system is swapped into a previously suspended process execution.

4.6 Process state transitions with a pending state


L block → block/suspend: OS typically swap blocking process to free up memory space

L blocking/suspending → ready/pending: When the blocking/suspending process waits for the event to occur, it can be converted to ready/pending.

L ready/Hang → ready: os needs to be transferred into a process execution.

L ready → ready/hang: Normally, OS hangs blocking process. But sometimes the ready process is suspended, freeing up enough memory space.

l  new → ready/pending (new → Ready): When a new process is created, it can be inserted into the ready queue or ready to suspend the queue, and a new → ready/suspend is required if there is not enough memory allocated to the new process.

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.