2013年2月2日 星期六

作業系統(3)


第三章 Process Concept

Current-day computer systems allow multiple programs to be loaded into memory and executed concurrently. This evolution required firmer control amd more compartmentalization of various programs;and these needs resulted in the notion of a process, which is a program in execution. A process is the unit of work in modern time-sharing system.

A process is more than the program code, which is sometimes known as the text section. It also includes the current activity, as represented by the value of the program counter and the contents of processor's registers. A process generally also includes the process stack and a data section, which contains global variables. A process may also include a heap, which is memory that is dynamically allocated during process run time.

As a process executes, it changes state: The state of a process is defined in part by the current activity of that process.

1.New – The process is being created.
2.Running – Instructions are being  executed.
3.Waiting – The process is waiting for some event to occur.
4.Ready – The process is waiting to be assigned to a processor.
5.Terminated – The process has finished execution.

Each process is represented in the operating system by a process control block(PCB) – also called a task control block.
1. Process state
2. Program counter
3. CPU registers
4. CPU-scheduling information
5. Memory-management information
6. Accounting information  – the amount of CPU and real time used, time limits, account numbers, job or process numbers, and so on.
7. I/O status information.


The operating system must select, for scheduling purposes, processes from these queues in some fashion. The selection process is carried out by the appropriate scheduler.


A socket is defined as an endpoint for communication. A pair of processes communicating over a network employ a pair of sockets.
The RPC(Remote Procedure Calls) was designed as a way to abstract the procedure-call mechanism for use between systems with network connections.

沒有留言:

張貼留言