有关应用程序池,工作进程和应用程序域的令人困惑的术语 [英] Confusing terminologies pertaining to Application Pool, Worker Process and Application Domain

查看:82
本文介绍了有关应用程序池,工作进程和应用程序域的令人困惑的术语的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对以下声明感到困惑,该声明取自 ASP.NET程序员应该了解的应用程序域:

I am confused with the statement below, taken from What ASP.NET Programmers Should Know About Application Domains :

您已经创建了两个ASP.NET 同一台服务器上的应用程序,以及 没有做任何特别的事情 配置.发生什么事了?

You’ve created two ASP.NET applications on the same server, and have not done any special configuration. What is happening?

单个ASP.NET辅助进程将 承载两个ASP.NET应用程序. 在Windows XP和Windows 2000上, 进程名为aspnet_wp.exe,并且 该过程在安全下运行 本地ASPNET帐户的上下文. 在Windows 2003上,辅助进程具有 名称w3wp.exe并在 默认情况下,NETWORK SERVICE帐户.

A single ASP.NET worker process will host both of the ASP.NET applications. On Windows XP and Windows 2000 this process is named aspnet_wp.exe, and the process runs under the security context of the local ASPNET account. On Windows 2003 the worker process has the name w3wp.exe and runs under the NETWORK SERVICE account by default.

他说,有一个工作进程产生了2个应用程序域,每个asp.net应用程序都有一个应用程序域.

He said that there is one worker process spawns 2 application domains--one application domain for each asp.net application.

但是当我看到正在运行的进程如下时,

But when I see the running processes as follows,

图片1

图片2

w3wp.exe被称为IIS工作进程,而不是应用程序池或应用程序域.

w3wp.exe is said as IIS Worker Process rather than application pool or application domain.

  1. 应用程序域等于应用程序池吗?
  2. 令人困惑的事情在图像1中.为什么Host Process Windows Service svchost.exe产生2个IIS Worker Process w3wp.exe?据我了解,一个进程只能包含应用程序域,不能包含其他进程.
  1. Is application domain equal to application pool?
  2. The confusing thing is in image 1. Why does Host Process Windows Service svchost.exe spawns 2 IIS Worker Process w3wp.exe? In my understanding, a process can only contain application domains, not other processes.

推荐答案

应用程序域 aka AppDomain (其类表示)是.NET运行时内部的封装环境,在该环境中加载并运行程序集.

Application domain aka AppDomain (its class representation) is an encapsulated environment inside a .NET runtime where assemblies are loaded and running.

通常,每个托管进程有一个AppDomain/Application域,但可以更多.本文在同一w3wp3.exe进程中引用了2个AppDomain.

Usually there is one AppDomain/Application domain per managed process but can be more. Here the article refers to 2 AppDomains inside the same w3wp3.exe process.

您可以使用perfmon.exe查看在任何进程中加载​​的AppDomain的数量

You can see number of AppDomains loaded in any process using perfmon.exe

为回答您的问题,通常每个一个AppPool创建一个AppDomain.但是,可以由应用程序在AppPool中手动加载额外的AppDomain,但这种情况很少见.

我认为您正在使用Sysinternals的Process Explorer.忽略其中显示树结构的方式,它仅说明哪个进程产生了其他进程.实际上,由于使用了explorer来加载资源,因此它显示了explorer下方的大多数进程.

I think you are using Process Explorer of the Sysinternals. Ignore the way it shows the tree structure in there, it only illustrates which process has spawned other processes. In fact it shows most processes underneath explorer since explorer has been used to load it.

SVCHOST.exe也是不受管理的可执行文件,尽管它可以承载CLR并加载AppDomain,但通常不会这样做.

Also SVCHOST.exe is an unmanaged executable and although it can host CLR and load AppDomains, it normally does not do that.

这篇关于有关应用程序池,工作进程和应用程序域的令人困惑的术语的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆