操作系统双语阅读 - PCB数据结构

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/sched.h>

Linux操作系统中的PCB是由C结构体task_struct表示,包含在<linux/sched.h>中。
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

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值