Operating System Principles of process management (Chapter II)

A description of the process of

Perform the sequence program:  Advanced START program memory to Perform in ⼀ a program execution is completed before ⾏ not Perform other programs.

 

 

 Features: sequential, closed, reproducibility

Perform concurrent program: Perform concurrent program refers in the same time interval ⼀ when running a multiple programs. Before the end of ⼀ programs Perform, other programs can be when running a

  • Macro parallel: the user to see multiple programs at the same time to move forward
  • Microscopic serial: any time only one CPU in a program execution

Features:

  • Intermittent: Perform the program on the CPU, in fits and starts
  • Lose closed: the state of the system is no longer only for the program is to perform to be ⻅
  • Irreproducibility: ⼀ with programs when running a plurality of times at the same input START case, different results may occur

When using the 12306 tickets, each user submits an order, I vote will be reduced, which reflects the (losing closure) program features concurrent execution

********************************process***************** *****************

Program: a set of instructions having a set of independent functions; static, permanent

Process: allowing concurrent execution of the program is running on a data set; process block is composed of the execution environment is controlled by the text segment, and processes user data segment; dynamic temporary

  • Text segment: the machine instruction is to perform to
  • User data segment: Use to store user data
  • Process control block: storage when running a process environment

Process characteristics:

  • Concurrency: multiple processes can run simultaneously entities within a time interval, complicated process and is an important feature of modern operating systems
  • Dynamic: the process is the execution entity (YES program -> Create process; get CPU-> Perform instruction; when running a medium for still -> revoked)
  • Independence: the basic unit when running a single attention immediately and resource scheduling
  • Asynchrony: Perform intermittent process, when YES, pause when both ⽆ method to predict
  • Structure: Using the process entity comprises user files positive section that allows the user data section and a process control block (PCB)

Processes and procedures contact:

  • Process is the execution of a program
  • A program can correspond to multiple processes
  • The same program can run on different data sets, composed of different processes

Process control block: ⼀ process control block is part of the process entities, the most important data structures of the operating system; the process control block is recorded in the operating system required, all the information transported Use perform the required control process and the process described in

  • Process identifier information: Use to CD ⼀ a process to identify ⼀
  • Processor status information: general purpose registers, instruction counter, program status word the PSW, a user stack pointer
  • Other information required includes the process status information, and process scheduling process priority: the process of scheduling information
  • Process control information: address, including programs and data, process synchronization and communication mechanisms, resource lists, and link pointer

Status of the process:

 

 

 Organization of the process: the link shutter mode, the index shutter mode, the process queue

  • Link Modes: the state of processes in the system with the same wherein control block PCB Use link connected to word queue ⼀
  • Index Modes: The system according to the state of all processes, attention immediately build the index table, each table entry index ⼀ table points ⼀ PCB physical block number
  • Process queue: the state of the process control block having the same queue organized Use

Second, the control process

Create: Use user login, job scheduling, provide service, you need to create a process to apply it when requested

To create a new process

  • 1. Application PCB if a blank
  • 2. The allocation of resources for the new process
  • 3. Initialize process control block
  • 4. Insert the new process to the ready queue

 

Obstruction: service request system, start some kind of operation, the new data is not yet reached, no matter if new ⼯ work to do to enter the blocked state

  • 1. The state of the process was changed to blocking state
  • 2. Insert the appropriate process of blocking queue
  • 3. Go to the process scheduler, choose from the ready queue process to assign CPU

wake

  • 1. The process is removed from the blocking queue
  • 2. The process status changed to ready state by the blocking state
  • 3. Insert the process ready queue

termination

  • 1. The reading process from the state in the process of PCB
  • YES 2. If the process is YES, the process for still end
  • 3. Release resources
  • 4. The final process to a still PCB removed

Third, the operating system kernel

Operating system management computer system resources, will provide ⽅ the Connector, the expansion of hardware function

The operating system kernel is the First Time expansion is closely related to computer hardware and hardware

Core functions:

  • ⽀ support functions: interrupt handling, clock management, primitive operations
  • Resource management: process management, storage management, device management

What is interrupted

Interrupts are changes to a wide kind of event handlers Perform instruction sequence; when an interrupt occurs, the computer is now down to stop when running a program, turn the processing of these interrupt events, after the end of the process is returned to the interrupted program at the current ⾏

Why break

After the lead START interrupt mechanism, and ⾏ ⼯ CPU can make with other devices, can effectively in response to high CPU Using the rate of interest

 

*********************************** clock ************** ****************************

 

 The importance of the clock: a clock pulse of a computer system, the computer's many activities are driven by the timing measurements

Clock application:

  • screen protector 
  • Time Display
  • File time stamps 
  • CPU time allocated to the process

Clock computer system: real-time clock RTC (CMOS clock), OS clock

 

 

 OS on the PC motherboard clock generator timer / counter chip, effective at boot time, the operating system controls.

After the computer boot power, obtain the value of the current operating system (RTC clock) by the BIOS as the system time

The operating system clock mechanism:   relying on hardware clock and clock drivers to save the current date and time, maintain a timer  

Clock Driver features:

  • 1) maintain the date and time
  • 2) decreasing the current process in the time remaining Perform ⼀ time still pictures, and prevents shifting when running a timeout
  • 3) Using the CPU billing
  • 4) decrement the alarm counter

Use ********************** ************************* system calls **

Use transfer system: The system is adjusted Use predefined group ⼀ module; providing ⼀ of the applications so that the pipeline can thus program to the service Center Weighted core; system call is Connector Using procedures between the system and the user program Use

Use indoor spaces: Use the address space in which the user process

Using the user state Perform: Perform Using the CPU when the code household space, saying the process is in user state Perform Use

System space: the address space containing nuclei Center Weighted ⼀ cutting system code

Perform system state: When the system CPU Perform Center Weighted nuclear codes, saying that the process is in the state system YES

The difference between the system call and the general function call as follows:

  • 1) system call in the system running state, and the general function runs in user mode.
  • 2) system call different execution and general function calls. When the system calls, the current process is interrupted by the system to find the appropriate system calls the subroutine, and executed under the state system, the results of the return process.
  • 3) system call to be "interrupt processing", more than the average number of function call overhead.

 

4 Process Synchronization

 

5 Process Communication

 

 

6 threads

Guess you like

Origin www.cnblogs.com/jalja/p/11628814.html