Operating System Learning notes (5)

Source: Internet
Author: User
Tags data structures

Swap technology, Exchange technology:
(swapping)
In order to free up memory space, swap out/swap in process (program or data, PCB can not be swapped out).

Reason for the pending state of the process:
-Process blocking All
-Heavy system load and tight memory space.
-the needs of the operating system.
-The end user's request.
-The requirements of the parent process.

Characteristics of the suspended process:
1. Cannot execute
2. May wait for a time to occur (selecting a pending process may be a blocked process)
3. The process to suspend is: itself, parent process, OS

Suspend and block
Problem:
1. Whether the blocking process can only be suspended.
2. How to activate the suspend process.
Differentiate between two concepts: "Wait Time"-block "swap out memory"-pending

Two additional states:
Ready/Pending
Blocking/suspending

Note:
There are two types of processes that can be scheduled to be executed by the processor:
1. The newly created process
2. Swap in a previously suspended process


===========================
Control of the process:

Two modes of execution:
1. System mode/control mode/kernel mode
-With high privileges
-System-specific instructions
-processor machine instructions, registers, and memory are fully controlled and protected
1. User mode
-Low privilege
-User Program


Mode switch:
User-System: System call
System-User: Execute system call
Special case: End of program, no longer returned to user mode


System Kernel (Kernel)
1. Hardware-based first-tier software expansion is the basis of operating system work.
2. Hardware-related, basic, public, high-frequency modules, and critical data structures are independent of the memory. have higher privileges.
3. System calls are implemented through the system kernel.
4. Kernel function: Resource management function and support function.

Resource features:
1. Process Management
2. Storage function
3. IO Device Management


Support function:
1. Terminal processing
2. Clock management
3. Primitive Language (Primitive): Atomic manipulation
4. Statistics
5. Monitoring


Process Control Primitives:
1. Process switching
2. Create and terminate
3. Blocking and Awakening
4. Suspend and activate


Process creation: Reason
1. Submit a new batch job
2. Interactive User Registration
3. Operating system provides tasks
4. Parent process creates child process

Process creation: Steps
1. Assign a unique flag number ID to a process terminate
2. Allocating space for a process
3. Initialize PCB
4. Establish links
5. Create or extend other data structures

Process termination: Reason
1. Execute to "end" statement
2. Interactive User "Logoff"
3. Stop the execution of a process
Specific causes: Normal end, timeout, out of memory, access out of bounds, calculation error, timeout wait event
IO failure, invalid instruction, privileged instruction, data type mismatch, etc.

Process termination: Step
1. Terminate ID, find PCB, read status
2. Terminating a child process
3. Process resource restitution system (or parent process)
3. Move the PCB

Blocking and waking of processes:
Block primitive, wake up primitive language

Pending and activation of the process:
Suspend primitive, activate primitive language

Process switching:
Clock interrupt
IO Interrupt
Access error
Trap

Process a switches to step B:
1. Protection process A field to PCB inside
2. Recovery process B on-site

Process switching vs Mode switching:
Process switching-"CPU conversion" must trigger a mode switch because the process switch must have a "system call". otherwise.
Mode Switch-"system call"



================================
Process scheduling:

What is dispatch.
In a queue, according to a certain algorithm, select a suitable individual process.

Scheduling target:
Fairness, processor utilization, increased system throughput, reduced process response time

Scheduling principle:
Meet the user's requirements
Meet the needs of the system

User-oriented principle: Response time
Evaluate the performance of time-sharing systems.

User-oriented principle: Cycle time
Evaluate the performance of batch processing systems.
Job scheduling, process scheduling, medium-range scheduling (hangs)

User-oriented principle: deadline
1. The latest time a task must perform, or the latest time it must complete, in a real-time system.
2. Evaluate the performance of real-time systems.

System-oriented principles: decency throughput

System-oriented principles: Processor utilization

System-oriented principles: balanced use of all types of resources

System-oriented principles: fairness

System-oriented principles: priority

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.