···进程的组成 * PCB(Process Control Block) 灵魂,进程存在的唯一标志 *程序 描述了进程要完成的功能,是进程执行时不可修改的部分。 *数据 进程执行时用到的数据 *工作区 参数传递、系统调用时使用的动态区域(堆栈区) ···进程控制块(PCB) 定义:是操作系统用来记 ...
分类:
系统相关 时间:
2020-03-05 13:26:40
阅读次数:
92
1、网上的版本(可以粗略看懂)structtask_struct{
volatilelongstate;
/*-1unrunnable,0runnable,>0stopped*/
void*stack;
//stackshouldpointstoathreadinfostruct
atomic_tusage;
//有几个进程正在使用该结构
unsignedintflags;
/*perprocessflags,definedbelow*/
//反应..
分类:
系统相关 时间:
2016-06-02 20:24:49
阅读次数:
855
#include "stdio.h" #include <stdlib.h> #include <conio.h> #define getpch(type) (type*)malloc(sizeof(type)) #define N 3 struct pcb { /* 定义进程控制块PCB */ c ...
分类:
系统相关 时间:
2016-05-13 14:02:02
阅读次数:
217
#include
#include
//Can only be used in independent situation;
//#define getmem(type) (type*)malloc(sizeof(type))
#define buffersize 5
int processnum=0;//the num of processes
struct pcb { /* 定义进...
分类:
系统相关 时间:
2016-05-12 11:50:42
阅读次数:
229
Linux内核创建一个新进程的过程 20135224陈实 + 原创作品转载请注明出处 + 《Linux内核分析》MOOC课程http://mooc.study.163.com/course/USTC-1000029000 简介: pcb定义:进程所需的各种执行与数据信息头 task_struct:一 ...
分类:
系统相关 时间:
2016-04-02 13:40:38
阅读次数:
215
//优先级调度算法#include#include#include#define getpch(type)(type*)malloc(sizeof(type))#define NULL 0struct pcb {/*定义进程控制块PCB*/char name[10];char state;int s...
分类:
其他好文 时间:
2015-06-01 13:19:10
阅读次数:
206
#include#include#define getpch(type)(type*)malloc(sizeof(type))#define NULL 0struct pcb{ //定义进程控制块PCB char name[10]; //进程名 char state; //状...
分类:
系统相关 时间:
2015-05-21 22:32:00
阅读次数:
304
#include"stdio.h"#include"stdlib.h" typedef struct PCB //定义进程控制块 { char ID[3]; //进程号 char name[10]; //进程名 char state; ...
分类:
其他好文 时间:
2015-05-07 21:41:40
阅读次数:
132