Linux中的PCB——tast_struct
来源:互联网 发布:苹果 联通4g劫持网络 编辑:程序博客网 时间:2024/04/30 22:04
PCB的意思是进程控制块,在Linux下的PCB就叫tast_strcut结构体。下面我们就来调研一下这个 tast_strcut里面有什么。
先列出一些总体概括:
1.pid
2.状态:任务状态,退出代码,退出信号等。
3.优先级:相对于其他进程的优先级
4.程序计数器:即将被执行的下一条指令地址
5.内存指针:存放程序代码和数据的指针,还有和其他进程共享内存块的指针。
6.上下文数据:进程执行时处理器的寄存器的数据
7.I/O状态信息:显示的I/O请求,分配给进程的I/O设备
8.记账信息:包括处理器的时间总和,记账号等等。
9.进程地址空间
10.其他信息
下面具体介绍一个重要的内容
一.进程状态(state)
二.进程标识符
三.进程调度信息(优先级)
policy表示进程的调度算法,一般有以下几种:
1.SCHED_NORMAL用于普通进程,通过CFS调度器实现
2.SCHED_BATCH用于非交互的处理器消耗型进程
3.SCHED_IDLE是在系统负载很低时使用
4.SCHED_FIFO(先入先出调度算法)和SCHED_RR(时间片轮转调度算法)都是实时调度策略.
四.进程标记
unsigned int flags; /* per process flags, defined below */
它的取值范围如下:
/** Per process flags*/#define PF_EXITING 0x00000004 /* getting shut down */#define PF_EXITPIDONE 0x00000008 /* pi exit done on shut down */#define PF_VCPU 0x00000010 /* I'm a virtual CPU */#define PF_WQ_WORKER 0x00000020 /* I'm a workqueue worker */#define PF_FORKNOEXEC 0x00000040 /* forked but didn't exec */#define PF_MCE_PROCESS 0x00000080 /* process policy on mce errors */#define PF_SUPERPRIV 0x00000100 /* used super-user privileges */#define PF_DUMPCORE 0x00000200 /* dumped core */#define PF_SIGNALED 0x00000400 /* killed by a signal */#define PF_MEMALLOC 0x00000800 /* Allocating memory */#define PF_NPROC_EXCEEDED 0x00001000 /* set_user noticed that RLIMIT_NPROC was exceeded */#define PF_USED_MATH 0x00002000 /* if unset the fpu must be initialized before use */#define PF_USED_ASYNC 0x00004000 /* used async_schedule*(), used by module init */#define PF_NOFREEZE 0x00008000 /* this thread should not be frozen */#define PF_FROZEN 0x00010000 /* frozen for system suspend */#define PF_FSTRANS 0x00020000 /* inside a filesystem transaction */#define PF_KSWAPD 0x00040000 /* I am kswapd */#define PF_MEMALLOC_NOIO 0x00080000 /* Allocating memory without IO involved */#define PF_LESS_THROTTLE 0x00100000 /* Throttle me less: I clean memory */#define PF_KTHREAD 0x00200000 /* I am a kernel thread */#define PF_RANDOMIZE 0x00400000 /* randomize virtual address space */#define PF_SWAPWRITE 0x00800000 /* Allowed to write to swap */#define PF_NO_SETAFFINITY 0x04000000 /* Userland is not allowed to meddle with cpus_allowed */#define PF_MCE_EARLY 0x08000000 /* Early kill for mce process policy */#define PF_MUTEX_TESTER 0x20000000 /* Thread belongs to the rt mutex tester */#define PF_FREEZER_SKIP 0x40000000 /* Freezer should not count it as freezable */#define PF_SUSPEND_TASK 0x80000000 /* this thread called freeze_processes and should not be frozen */
五.表示进程亲属关系的成员
阅读全文
0 0
- Linux中的PCB——tast_struct
- Linux2.6.32 PCB内tast_struct的简述
- linux中的PCB---task_struct
- struct tast_struct 和mm_struct成员中的冰山一角
- linux — 进程PCB详解
- Linux(四):Linux中的进程控制块(PCB)—task_struct(部分字段)
- Linux中进程描述符tast_struct结构体详解
- 【Linux】PCB中的task_struct结构体
- 【Linux】浅谈Linux下的PCB—task_struct结构体
- Linux之进程的PCB——task_struct
- pcb:PROTEL99SE pcb中的功能
- task_struct结构体字段介绍--Linux中的PCB
- task_struct结构体字段介绍--Linux中的PCB
- task_struct结构体字段介绍--Linux中的PCB
- PCB设计技巧Tips1——PCB布线
- 进程控制块—PCB
- tast_struct结构体
- PCB设计中的EMC
- EventBus3.0 List事件遇到的坑
- Centos7.3安装和配置Java JDK 1.8
- Android简单实现高德地图显示及定位
- Hadoop实战一
- 一致性哈希算法与Java实现
- Linux中的PCB——tast_struct
- js验证失败后阻止提交
- 关于opencv在代码正确的情况下,无法显示图像的问题。
- RecyclerView设置addItemDecoration在Fragment中不显示
- JavaScript之闭包
- andriod——Retrofit+Fresco+MVP接口拼接传值
- android制定统一的ProgressBar以及统一的提示页面
- [Heoi2013]Segment
- 一些有用的链接地址_20171206