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

📄 readme.txt

📁 模拟哲学家就餐过程
💻 TXT
字号:
========================================================================
       MICROSOFT FOUNDATION CLASS LIBRARY : ThreadCompete
========================================================================

AppWizard has created this ThreadCompete application for you.  This application
not only demonstrates the basics of using the Microsoft Foundation classes
but is also a starting point for writing your application.

This file contains a summary of what you will find in each of the files that
make up your ThreadCompete application.

ThreadCompete.dsp
    This file (the project file) contains information at the project level and
    is used to build a single project or subproject. Other users can share the
    project (.dsp) file, but they should export the makefiles locally.

ThreadCompete.h
    This is the main header file for the application.  It includes other
    project specific headers (including Resource.h) and declares the
    CThreadCompeteApp application class.

ThreadCompete.cpp
    This is the main application source file that contains the application
    class CThreadCompeteApp.

ThreadCompete.rc
    This is a listing of all of the Microsoft Windows resources that the
    program uses.  It includes the icons, bitmaps, and cursors that are stored
    in the RES subdirectory.  This file can be directly edited in Microsoft
	Visual C++.

res\ThreadCompete.rc2
    This file contains resources that are not edited by Microsoft 
	Visual C++.  You should place all resources not editable by
	the resource editor in this file.

/////////////////////////////////////////////////////////////////////////////

For the main frame window:

MainFrm.h, MainFrm.cpp
    These files contain the frame class CMainFrame, which is derived from
    CFrameWnd and controls all SDI frame features.

/////////////////////////////////////////////////////////////////////////////
Other standard files:

StdAfx.h, StdAfx.cpp
    These files are used to build a precompiled header (PCH) file
    named ThreadCompete.pch and a precompiled types file named StdAfx.obj.

Resource.h
    This is the standard header file, which defines new resource IDs.
    Microsoft Visual C++ reads and updates this file.

/////////////////////////// 主要工作函数说明 /////////////////////////////////////

	管理临界区竞争这里介绍了两种对象,选择其中的之一即可

Readme.txt 本文件

ChildView.cpp 和 ChildView.h
	视图窗体类,其中的 CThreadCollection  *pCollect 指向线程集管理,它的建立析构与管理多线程的工作。

ThreadCollection.h
	这是多线程的类定义,由CWinThread 派生,其中应用动态矩阵管理多线程和多餐具
		
ThreadCollection.cpp
	这是多线程的类函数,线程集合的创建与析构管理着线程的创建与撤消。
	诸线程的优先级、时距、激活顺序(随机)、取无方向倾向及其先取何物(随机)、OS线程调度算法等因数都会影响执行效果。
	这里简单地处理“优先级”、“时距”为同一值了。
	
PersonThread.cpp
	这是一个线程的类函数,其中的算法仅是一种通用的随机算法。
	
/////////////////////////////////////////////////////////////////////////////

⌨️ 快捷键说明

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