进程控制块(PCB)结构

本文详细介绍了Linux系统中进程控制块(PCB)的结构,包括调度数据成员如进程状态、优先级、时间片等,进程队列指针,进程标识,时间数据成员,文件系统数据成员以及内存数据成员等。同时提到了makefile在编译过程中的作用和基本规则。
摘要由CSDN通过智能技术生成

一、进程控制块(PCB)结构

进程控制块(PCB)是系统为了管理进程设置的一个专门的数据结构。系统用它来记录进程的外部特征,描述进程的运动变化过程。同时,系统可以利用PCB来控制和管理进程,所以说,PCB(进程控制块)是系统感知进程存在的唯一标志。

Linux系统的PCB包括很多参数,每个PCB约占1KB多的内存空间。用于表示PCB的结构task_struct简要描述如下:

include/linux/sched.h
struct task_struct {
 volatile long state;
 struct thread_info *thread_info;
 atomic_t usage;
unsigned long flags;
unsigned long ptrace;
 
 int lock_depth;
 
 int prio, static_prio;
 struct list_head run_list;
 prio_array_t *array;
 
 unsigned long sleep_avg;
 long interactive_credit;
 unsigned long long timestamp;
 int activated;
 
 unsigned long policy;
 cpumask_t cpus_allowed;
 unsigned int time_slice, first_time_slice;
 
struct list_head tasks;
 struct list_head ptrace_children;
 struct list_head ptrace_list;
 
 struct mm_struct *mm, *active_mm;
...
 struct linux_binfmt *binfmt;
 int exit_code, exit_signal;
 int pdeath_signal;
...
 pid_t pid;
 pid_t tgid;
...
struct 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值