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

📄 csdn技术中心 windows2000 进程-线程分析(一).htm

📁 I:Windows2000 进程-线程分析(一).
💻 HTM
📖 第 1 页 / 共 5 页
字号:
            style="COLOR: blue; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">),实际上应该就是保存在磁盘或其他介质中的可执行文件。</SPAN><SPAN 
            lang=EN-US style="COLOR: blue"><o:p></o:p></SPAN></FONT></P>
            <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN 
            lang=EN-US><o:p><FONT size=3>&nbsp;</FONT></o:p></SPAN></P>
            <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><FONT size=3><SPAN 
            lang=EN-US>Windows</SPAN><SPAN 
            style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">提供以下方法用于在不同进程之间共享数据:</SPAN></FONT></P>
            <P class=MsoNormal 
            style="MARGIN: 0cm 0cm 0pt 42.75pt; TEXT-INDENT: -21pt; tab-stops: list 42.75pt; mso-list: l0 level1 lfo2"><SPAN 
            lang=EN-US 
            style="FONT-FAMILY: Wingdings; mso-bidi-font-family: Wingdings; mso-fareast-font-family: Wingdings"><SPAN 
            style="mso-list: Ignore"><FONT size=3>l</FONT><SPAN 
            style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
            </SPAN></SPAN></SPAN><FONT size=3><SPAN 
            style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">动态数据交换(</SPAN><SPAN 
            lang=EN-US>DDE</SPAN><SPAN 
            style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">)</SPAN></FONT></P>
            <P class=MsoNormal 
            style="MARGIN: 0cm 0cm 0pt 42.75pt; TEXT-INDENT: -21pt; tab-stops: list 42.75pt; mso-list: l0 level1 lfo2"><SPAN 
            lang=EN-US 
            style="FONT-FAMILY: Wingdings; mso-bidi-font-family: Wingdings; mso-fareast-font-family: Wingdings"><SPAN 
            style="mso-list: Ignore"><FONT size=3>l</FONT><SPAN 
            style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
            </SPAN></SPAN></SPAN><FONT size=3><SPAN lang=EN-US>OLE</SPAN><SPAN 
            style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">、</SPAN><SPAN 
            lang=EN-US>COM</SPAN></FONT></P>
            <P class=MsoNormal 
            style="MARGIN: 0cm 0cm 0pt 42.75pt; TEXT-INDENT: -21pt; tab-stops: list 42.75pt; mso-list: l0 level1 lfo2"><SPAN 
            lang=EN-US 
            style="FONT-FAMILY: Wingdings; mso-bidi-font-family: Wingdings; mso-fareast-font-family: Wingdings"><SPAN 
            style="mso-list: Ignore"><FONT size=3>l</FONT><SPAN 
            style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
            </SPAN></SPAN></SPAN><SPAN 
            style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'"><FONT 
            size=3>管道和邮箱</FONT></SPAN></P>
            <P class=MsoNormal 
            style="MARGIN: 0cm 0cm 0pt 42.75pt; TEXT-INDENT: -21pt; tab-stops: list 42.75pt; mso-list: l0 level1 lfo2"><SPAN 
            lang=EN-US 
            style="FONT-FAMILY: Wingdings; mso-bidi-font-family: Wingdings; mso-fareast-font-family: Wingdings"><SPAN 
            style="mso-list: Ignore"><FONT size=3>l</FONT><SPAN 
            style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
            </SPAN></SPAN></SPAN><SPAN 
            style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'"><FONT 
            size=3>内存映射文件</FONT></SPAN></P>
            <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN 
            lang=EN-US><o:p><FONT size=3>&nbsp;</FONT></o:p></SPAN></P>
            <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN 
            lang=EN-US><o:p><FONT size=3>&nbsp;</FONT></o:p></SPAN></P>
            <P class=MsoNormal 
            style="MARGIN: 0cm 0cm 0pt 21pt; TEXT-INDENT: -21pt; tab-stops: list 21.0pt; mso-list: l2 level1 lfo1"><B><SPAN 
            lang=EN-US 
            style="FONT-SIZE: 14pt; mso-bidi-font-size: 12.0pt; mso-bidi-font-family: 宋体"><SPAN 
            style="mso-list: Ignore">二、<SPAN 
            style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
            </SPAN></SPAN></SPAN></B><B><SPAN 
            style="FONT-SIZE: 14pt; FONT-FAMILY: 宋体; mso-bidi-font-size: 12.0pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">进程</SPAN></B><B><SPAN 
            lang=EN-US 
            style="FONT-SIZE: 14pt; mso-bidi-font-size: 12.0pt"><o:p></o:p></SPAN></B></P>
            <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><B><SPAN lang=EN-US 
            style="FONT-SIZE: 12pt">2</SPAN></B><B><SPAN 
            style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">.</SPAN></B><B><SPAN 
            lang=EN-US style="FONT-SIZE: 12pt">1 </SPAN></B><B><SPAN 
            style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">概述</SPAN></B><SPAN 
            lang=EN-US style="FONT-SIZE: 12pt"><o:p></o:p></SPAN></P>
            <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN 
            style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'"><FONT 
            size=3>进程通常被定义为一个正在运行的程序的对象的实例,它有两个部分组成:</FONT></SPAN></P>
            <P class=MsoNormal 
            style="MARGIN: 0cm 0cm 0pt 42pt; TEXT-INDENT: -21pt; tab-stops: list 42.0pt; mso-list: l2 level2 lfo1"><SPAN 
            lang=EN-US 
            style="FONT-FAMILY: Wingdings; mso-bidi-font-family: Wingdings; mso-fareast-font-family: Wingdings"><SPAN 
            style="mso-list: Ignore"><FONT size=3>l</FONT><SPAN 
            style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
            </SPAN></SPAN></SPAN><SPAN 
            style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'"><FONT 
            size=3>一个是操作系统用来管理进程的内核对象。内核对象也是系统用来存放关于进程的统计信息的地方。</FONT></SPAN></P>
            <P class=MsoNormal 
            style="MARGIN: 0cm 0cm 0pt 42pt; TEXT-INDENT: -21pt; tab-stops: list 42.0pt; mso-list: l2 level2 lfo1"><SPAN 
            lang=EN-US 
            style="FONT-FAMILY: Wingdings; mso-bidi-font-family: Wingdings; mso-fareast-font-family: Wingdings"><SPAN 
            style="mso-list: Ignore"><FONT size=3>l</FONT><SPAN 
            style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
            </SPAN></SPAN></SPAN><FONT size=3><SPAN 
            style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">另一个是地址空间,它包含所有可执行模块或</SPAN><SPAN 
            lang=EN-US>DLL</SPAN><SPAN 
            style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的代码和数据。它还包含动态内存分配的空间。如线程堆栈和堆(</SPAN><SPAN 
            lang=EN-US>Heaps</SPAN><SPAN 
            style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">)分配空间。</SPAN></FONT></P>
            <P class=MsoNormal 
            style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt"><FONT size=3><SPAN 
            style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">进程是不活泼的。要是进程完成某项操作,它必须拥有一个在它的环境中运行的线程,该线程负责执行包含在进程的地址空间中的代码。实际上,单个进程可能包含若干个线程,所有这些线程都“同时”执行进程地址空间中的代码。为此,每个线程都有他自己的一组</SPAN><SPAN 
            lang=EN-US>CPU</SPAN><SPAN 
            style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">寄存器(即,线程的上下文,定义在:</SPAN><SPAN 
            lang=EN-US>WinNT.h</SPAN><SPAN 
            style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">头文件中)和它自己的堆栈。但是,由于</SPAN><SPAN 
            lang=EN-US>Windows</SPAN><SPAN 
            style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">中,是针对进程来分配系统资源的。所以,线程的堆栈实际上位于其所属进程的虚拟地址空间中。每个进程至少拥有一个线程,来执行进程地址空间中的代码。如果没有线程来执行进程的地址空间中的代码,那么进程就没有存在的理由了,系统将自动撤销该进程和它的地址空间。</SPAN></FONT></P>
            <P class=MsoNormal 
            style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt"><FONT size=3><SPAN 
            style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">若要使所有线程都能运行,操作系统就要为每个线程安排一定的</SPAN><SPAN 
            lang=EN-US>CPU</SPAN><SPAN 
            style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">时间片。它通过一种循环方式为线程提供时间片(称为:量程),造成一种假象,仿佛所有线程都是同时运行的一样。</SPAN></FONT></P>
            <P class=MsoNormal 
            style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt"><SPAN 
            style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'"><FONT 
            size=3>当创建一个进程时,系统会自动创建它的第一个线程,成为主线程。然后,该线程可以创建其他的线程或者进程。</FONT></SPAN></P>
            <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN 
            lang=EN-US><o:p><FONT size=3>&nbsp;</FONT></o:p></SPAN></P>
            <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><B><SPAN lang=EN-US 
            style="FONT-SIZE: 12pt">2</SPAN></B><B><SPAN 
            style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">.</SPAN></B><B><SPAN 
            lang=EN-US style="FONT-SIZE: 12pt">2 Windows</SPAN></B><B><SPAN 
            style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">应用程序概述</SPAN></B></P>
            <P class=MsoNormal 
            style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><FONT 
            size=3><SPAN lang=EN-US>Windows</SPAN><SPAN 
            style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">支持两类应用程序:</SPAN></FONT></P>
            <P class=MsoNormal 
            style="MARGIN: 0cm 0cm 0pt 42.75pt; TEXT-INDENT: -21pt; tab-stops: list 42.75pt; mso-list: l3 level1 lfo3"><SPAN 
            lang=EN-US 
            style="FONT-FAMILY: Wingdings; mso-bidi-font-family: Wingdings; mso-fareast-font-family: Wingdings"><SPAN 
            style="mso-list: Ignore"><FONT size=3>l</FONT><SPAN 
            style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
            </SPAN></SPAN></SPAN><FONT size=3><SPAN 
            style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">基于图形用户界面(</SPAN><SPAN 
            lang=EN-US>GUI</SPAN><SPAN 
            style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">)的应用程序</SPAN></FONT></P>
            <P class=MsoNormal 
            style="MARGIN: 0cm 0cm 0pt 42.75pt; TEXT-INDENT: -21pt; tab-stops: list 42.75pt; mso-list: l3 level1 lfo3"><SPAN 
            lang=EN-US 
            style="FONT-FAMILY: Wingdings; mso-bidi-font-family: Wingdings; mso-fareast-font-family: Wingdings"><SPAN 
            style="mso-list: Ignore"><FONT size=3>l</FONT><SPAN 
            style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
            </SPAN></SPAN></SPAN><FONT size=3><SPAN 
            style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">基于控制台用户界面(</SPAN><SPAN 
            lang=EN-US>CUI</SPAN><SPAN 
            style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">)的应用程序</SPAN></FONT></P>
            <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN 
            lang=EN-US><o:p><FONT size=3>&nbsp;</FONT></o:p></SPAN></P>
            <P class=MsoNormal 
            style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><FONT 
            size=3><SPAN lang=EN-US>Windows</SPAN><SPAN 
            style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">应用程序必须有一个在程序启动时调用的<SPAN 
            style="BACKGROUND: #d9d9d9; mso-shading: white; mso-pattern: gray-15 auto">进入点函数</SPAN>。可使用的进入点如下图所示:</SPAN></FONT></P>
            <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: center" 
            align=center><SPAN lang=EN-US><v:shape id=_x0000_i1026 
            style="WIDTH: 414.75pt; HEIGHT: 138.75pt" type="#_x0000_t75"><IMG 
            src="CSDN技术中心 Windows2000 进程-线程分析(一).files/CSDN_Dev_Image_2003-10-231455152.jpg" 
            o:title="application entry point"><FONT 
            size=3></FONT></v:shape></SPAN></P>
            <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN 
            lang=EN-US><o:p><FONT size=3>&nbsp;</FONT></o:p></SPAN></P>
            <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><B><SPAN lang=EN-US 
            style="FONT-SIZE: 12pt">2</SPAN></B><B><SPAN 
            style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; ms

⌨️ 快捷键说明

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