什么是申请和流程?
一个应用程序由一个或多个进程组成。进程,用最简单的话来说,就是一个正在执行的程序。一个或多个线程在进程的上下文中运行。线程是操作系统分配处理器时间的基本单位。线程可以执行进程代码的任何部分,包括当前由另一个线程执行的部分。 来源:http://msdn.microsoft.com/ en-us/library/ms684841%28VS.85%29.aspx
我了解线程,但我无法区分应用程序和应用程序过程。什么是应用?什么是流程?一个应用程序如何拥有多个进程?请给我一个 C# 示例。谢谢。
更新:我还有一个关于 WinWord 的问题。当您运行 WinWord 应用程序时,将打开一个编辑器窗口。在此窗口中,单击工具栏上的“新建”按钮,将打开第二个编辑器窗口。问题:第二个窗口是否在另一个进程中运行?如果是的话,为什么我使用任务管理器时,我只看到一个 WinWord 进程名称。谢谢。
An application consists of one or more processes. A process, in the simplest terms, is an executing program. One or more threads run in the context of the process. A thread is the basic unit to which the operating system allocates processor time. A thread can execute any part of the process code, including parts currently being executed by another thread.
Source: http://msdn.microsoft.com/en-us/library/ms684841%28VS.85%29.aspx
I understand about thread, but I can't distinguish between application & process. What is application? What is process? How do an application have more than 1 process? And please give me an example in C#. Thanks.
Update: I have another question about WinWord. When you run WinWord application, a editor window will open. And from this window, you click on New button on Toolbar, 2nd editor window will open. Question: Is the 2nd window running in another process? If yes, why I use Task Manager, I only see one WinWord process name. Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
虽然“进程”和“线程”具有明确定义的含义,但“应用程序”却没有,至少在 Windows 平台上是这样。通常,“应用程序”和“进程”之间存在一一对应的关系,但应用程序可以作为一组进程来实现,这些进程一起工作来解决特定问题。
例如,VMWare Workstation 就是一个应用程序。它可能涉及多个进程一起运行来实现其目标,例如 vmware.exe、vmware-authd.exe 等。
While "process" and "thread" have well-defined meanings, "application" doesn't, at least on the Windows platform. Usually there's a one-to-one correspondence between "application" and "process", but an application may be implemented as a suite of processes that work together to solve a particular problem.
For example, VMWare Workstation is an application. It may involve several processes running together to accomplish its goals, for instance vmware.exe, vmware-authd.exe, and others.