PCB或过程控制块,在维基百科上定义如下
过程控制块(PCB,又称任务控制块、1任务结构或开关帧)是操作系统内核中包含管理特定进程所需信息的数据结构。PCB是“操作系统中进程的表现形式”。
它的职责是:
Process identification data
Processor state data
Process control data那么,在哪里可以找到一个过程的PCB?
发布于 2014-08-18 07:38:45
在Linux内核中,每个进程都由一个双链接列表中的task_struct表示,该列表的头是init_task (pid 0,而不是pid 1)。这通常被称为过程表。
在用户模式下,流程表在/proc下对普通用户是可见的。以标题来回答你的问题:
/proc/<process-id>/...中)、命令行(cmd),可能还有其他属性,这取决于您对“标识”的定义。sched、stat和schedstat)、进程当前等待的内容(wchan)、其环境(environ)等。uid_map)和资源限制(limits)。所以这完全取决于你如何定义你的术语..。但是通常,有关进程的所有数据都可以在/proc中找到。
发布于 2021-12-10 17:47:40
linux中的PCB是线程_信息结构的一部分。
struct thread_info {
struct pcb_struct pcb; /* palcode state */
struct task_struct *task; /* main task structure */
unsigned int flags; /* low level flags */
unsigned int ieee_state; /* see fpu.h */
mm_segment_t addr_limit; /* thread address space */
unsigned cpu; /* current CPU */
int preempt_count; /* 0 => preemptable, <0 => BUG */
unsigned int status; /* thread-synchronous flags */
int bpt_nsaved;
unsigned long bpt_addr[2]; /* breakpoint handling */
unsigned int bpt_insn[2];};
struct pcb_struct {
unsigned long ksp; - Kernel Stack Pointer
unsigned long usp; - User stack Pointer
unsigned long ptbr; - Page table address
unsigned int pcc;
unsigned int asn;
unsigned long unique;
unsigned long flags;
unsigned long res1, res2;};https://unix.stackexchange.com/questions/150734
复制相似问题