the PCB is expanded to include information for each thread.
PCB(进程控制块)被扩展为线程存储信息。
PROCESS REPRESENTATION IN LINUX
进程在Linux中的表示
The process control block in the Linux operating system is represented by the C structure task_struct, which is found in the
Linux操作系统中的PCB是由C结构体task_struct表示,包含在中。
This structure contains all the necessary information for representing a process, including the state of the process, scheduling and memory-management information, list of open files,and pointers to the process’s parent and a list of its children and siblings.
(A process’s parent is the process that created it; its children are any processes that it creates. Its siblings are children with the same parent process.) Some of these fields include:
这结构体包含所有需要表示进程的信息,包括进程状态,调度和内存管理信息,打开的文件的列表,和进程父母指针和它的孩子列表和兄弟节点。(进程的父母是创建它的进程,孩子是它创建的进程,它的兄弟是是它父母节点的其它孩子节点。其中包括:
long state; /* state of the process */
struct sched entity se; /* scheduling information */
struct task struct *parent; /* this process’s parent */
struct list head children; /* this process’s children */
struct files struct *files; /* list of open files */
struct mm struct *mm; /* address space of this process */
Within the Linux kernel, all active processes are represented using a doubly linked list of task_struct. The kernel maintains a pointer—current—to the process currently executing on the system.
在Linux kernel中,所有的进程都是用双链表表示的,双链表带的数据是task_struct.kernel保存一个current指针,指向当前系统中执行的进程。
For a single-processor system, there will never be more than one running process. If there are more processes, the rest will have to wait until the CPU is free and can be rescheduled.
对于单进程的系统,永远也只能有一个进程运行。如果内存存在多于一个进程,那么其余进程就会要等待,当CPU空闲的时候,就重新开始调度。
a job queue, which consists of all processes in the system. The processes that are residing in main memory and are ready and waiting to execute are kept on a list called the ready queue.
作业对也由系统中的所有进程组成。进程驻留在主存中处于准备和等待状态的都保存在一个列表中,改列表叫做准备队列。
等待需要的I/O设备的进程队列叫做设备队列。每个设备队列都有自己的设备队列。
The list of processes waiting for a particular I/O device is called a device queue. Each device has its own device queue
Queueing-diagram representation of
process scheduling