pcb.cpp

来自「这是软件工程的关于模拟进程调度的课程论文」· C++ 代码 · 共 41 行

CPP
41
字号
// PCB.cpp: implementation of the PCB class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "ProcessManager.h"
#include "PCB.h"

#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////



PCB::PCB(UINT prio, UINT ttime, UINT nid, CString strname)
{
	ASSERT(prio<256);
	ASSERT((ttime<400) && (ttime>10));
	ASSERT(nid<256);

	//initial
	this->priority = prio;
	this->total_time = ttime;
	this->nid = nid;
	this->strname = strname;

	//other infomation
	this->sleep_time = 0;				
	this->dynprio = 0;			
	this->current_time = 0;		
	this->state = PS_NOTHING;		//新建进程都无状态
	this->next = this->prev = NULL;
	this->wait_time = 0;
}

⌨️ 快捷键说明

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