⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pcb.h

📁 这是软件工程的关于模拟进程调度的课程论文
💻 H
字号:
// PCB.h: interface for the PCB class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_PCB_H__481A94E2_A86B_4234_BA92_D67AA6E3D468__INCLUDED_)
#define AFX_PCB_H__481A94E2_A86B_4234_BA92_D67AA6E3D468__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

//Process state macrol
#define PS_SLEEP	0
#define PS_RUNNING	1
#define PS_SUPPOND	2
#define PS_READY	3
#define PS_NOTHING  4
#define PS_ACTIVE	5



#ifdef DEBUG
static void _IAssert(char* , unsigned); /* 原型 */
#define IASSERT(f) \
if(f) \
NULL; \
else \
_IAssert(__FILE__ , __LINE__)
#else
#define IASSERT(f) NULL
#endif

static void _IAssert(char* strFile, unsigned uLine)
{
	CString str;
	str.Format("\nAssertion failed: %s, line %u\n",strFile, uLine);
	::AfxMessageBox(str);
}




struct PCB
{
public:
	PCB(UINT prio, UINT ttime, UINT nid, CString strname);
	CString strname;	//进程名字
	DWORD state;		//进程状态	
	UINT nid;			//进程ID值	
	UINT priority;		//进程静态优先级

	UINT dynprio;		//进程的动态优先级

	struct PCB * next;	//指向下一个进程的指针
	struct PCB * prev;	//指向上一个进程的指针
	UINT current_time;	//进程已经运行时间
	UINT total_time;	//进程运行总时间
	UINT sleep_time;	//进程的休眠时间
	UINT wait_time;		//进程的等待总时间
};



struct QueueNode
{
	struct PCB* ppcb;			//指向进程的指针
	struct QueueNode * next;	//队列后导指针
	struct QueueNode * prev;	//队列前向指针
	QueueNode()
	{
		ppcb = NULL;
		next = this;
		prev = this;
	}

	QueueNode(struct PCB* _ppcb)
	{
		ppcb = _ppcb;
		next = NULL;
		prev = NULL;
	}
};



#endif // !defined(AFX_PCB_H__481A94E2_A86B_4234_BA92_D67AA6E3D468__INCLUDED_)

⌨️ 快捷键说明

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