pcb.h

来自「CPU调度算法---模拟OS所使用的所有调度算法,包括创建一个kernel,PC」· C头文件 代码 · 共 62 行

H
62
字号
# if !defined(__PCB_H)
	# define __PCB_H
# endif

# if !defined(__STDIO_H)
	# include <stdio.h>
# endif

# if !defined(__STRING_H)
	# include <string.h>
# endif

class PCB
{
public:
	long PC;
	int index;
	unsigned short Priority;
	PCB *next;
	FILE *fp;
	char * file;
	long BurstTime;

	PCB()
	{
		next=NULL;
		PC = 0;
		index = 0;
		Priority = 5;
		/*filename="";
		BurstTime = 0;
		fp = NULL;*/
	}

	PCB(char * filename)
	{
		next=NULL;
		PC = 0;
		index = 0;
		Priority = 5;
		file = filename;
		fp = fopen(filename,"rb");
		long curpos = ftell(fp);
		fseek(fp, 0L, SEEK_END);
		BurstTime = ftell(fp);
		fseek(fp, curpos, SEEK_SET);
	}

	PCB(char * filename,unsigned short p)
	{
		next=NULL;
		PC = 0;
		index = 0;
		Priority = p;
		file = filename;
		fp = fopen(filename,"rb");
		long curpos = ftell(fp);
		fseek(fp, 0L, SEEK_END);
		BurstTime = ftell(fp);
		fseek(fp, curpos, SEEK_SET);
	}
};

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?