4.1
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 the processor's registers. A process generally also includes the
process stack, which contains temporary data (such as method parameters, return
addresses, and local variables), 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.
Process Control Block
Each process is represented in the operating system by a process control block(PCB)—also called a task control block. A PCB is shown in Figure 4.2. It contains many pieces of information associated with a specific process, including these:
• Process state: The state may be new, ready, running, waiting, halted, and so on.
• Program counter: The counter indicates the address of the next instruction to be executed for this process.
• CPU registers: The registers vary in number and type, depending on the computer architecture. They include accumulators, index registers, stack pointers, and general-purpose registers, plus any condition-code information. Along with the program counter, this state information must be saved when an interrupt occurs, to allow the process to be continued correctly afterward (Figure 4.3).
• CPU-scheduling information: This information includes a process priority,pointers to scheduling queues, and any other scheduling parameters. (Chapter 6 describes process scheduling.)
• Memory-management information: This information may include such
information as the value of the base and limit registers, the page tables, or the segment tables, depending on the memory system used by the operating system (Chapter 9).
• Accounting information: This information includes the amount of CPU and real time used, time limits, account numbers, job or process numbers, and so on.
• I/O status information: This information includes the list of I/O devices allocated to the process, a list of open files, and so on.
4.2
Scheduling Queues The list of processes waiting for a particular I/O device is called a device queue. Each device has its own device queue
Often, in a batch system, more processes are submitted than can be executed immediately. These processes are spooled to a mass-storage device (typically a disk), where they are kept for later execution. The long-term scheduler, or job scheduler, selects processes from this pool and loads them into memory for execution. The short-term scheduler, or CPU scheduler, selects from among the
processes that are ready to execute and allocates the CPU to one of them.
When a context switch occurs, the kernel saves the context of the old process in its PCB and loads the saved context of the new process scheduled to run. Context-switch time is pure overhead, because the system does no useful work while switching. Its speed varies from machine to machine, depending
on the memory speed, the number of registers that must be copied, and the existence of special instructions (such as a single instruction to load or store allregisters)
4.3
Process Creation
In general, a process will need certain resources (CPU time, memory, files, I/Odevices) to accomplish its task. When a process creates a subprocess, that subprocess may be able to obtain its resources directly from the operating system, or it may be constrained to a subset of the resources of the parent process. The parent may have to partition its resources among its children, or it may be able to
share some resources (such as memory or files) among several of its children. Restricting a child process to a subset of the parent's resources prevents any process from overloading the system by creating too many subprocesses.
There are also two possibilities in terms of the address space of the new process:
1. The child process is a duplicate of the parent process (it has the same program and data as the parent).
2. The child process has a new program loaded into it.
4.5
Interprocess Communication
IPC provides a mechanism to allow processes to communicate and to synchronize their actions without sharing the same address space. IPC is particularly useful in a distributed environment, where the communicating processes may reside on different computers connected with a network.
- 大小: 15.6 KB
分享到:
相关推荐
随机信号处理英文教程probability and random processes This book has been written for several reasons, not all of which are academic. This material was for many years the rst half of a book in progress ...
Stochastic Processes," which I have taught a number of times at Duke University. The majority of the students in the course are graduate students from departments other than mathematics, including ...
This book is intended to be used as a text for either undergraduate level (junior/senior) courses in probability or introductory graduate level courses in random processes that are commonly found in ...
Probability & Random Processes for Electrical and Computer Engineers
Discrete Stochastic Processes Gallager Discrete Stochastic Processes Gallager
Essentials of Stochastic Processes课后习题答案
Since process engineers and project managers face a diversity of approaches and standards that is hard to manage, defining and enacting appropriate processes constitute a challenging task that is ...
To that end, we propose a demonstration of PROPOLIS, a system for PROvisioned PrOcess anaLysIS, namely analy- sis of data-centric processes under hypothetical modification scenarios. Our solution is ...
advances in gaussian processes ppt
Probability, Random Variables and Stochastic Processes 英文第四版。 作者是Athanasios Papoulis。帕普里斯教授,他1921年出生于希腊,分别从雅典国家技术大学和美国宾夕法尼亚大学获得电子工程和数学学位。他...
This definitive textbook provides a solid introduction to discrete and continuous stochastic processes, tackling a complex field in a way that instils a deep understanding of the relevant mathematical...
INSTRUCTOR'S SOLUTIONS MANUAL Probability, Statistics, and Random Processes for Electrical Engineering_A. Leon-Garcia,国外的随机课程经典教材,这个文档是课后习题答案
深度学习neural-processes的代码,可以运行测试,是学习neural-processes的入门参考代码,包含neural-processes设计算法的基本功能及思路。
Sidney的经典教材Adventures in Stochastic Processes,适合有很强数学或概率基础的人学习
Wiley2010新书-Igneous Rocks and Processes高清非扫描
Probability, Statistics, and Random Processes For Electrical Engineering, 3ed,概率,统计和随机过程在电子工程中的应用
学习Markov decision processes 的一本好教材
Probability, Random Variables and Stochastic Processes Solutions 第四版的答案,英文版
LO020-processes in procurement