我不明白的应用程序域 [英] I don't understand Application Domains

查看:190
本文介绍了我不明白的应用程序域的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

.NET具有应用领域这一概念,它从我的理解可以用来组装加载到内存中。我已经做了在应用程序域的一些研究,以及去我的本地书店查找有关此主题的一些额外的知识,但它似乎非常稀少。

.NET has this concept of Application Domains which from what I understand can be used to load an assembly into memory. I've done some research on Application Domains as well as go to my local book store for some additional knowledge on this subject matter but it seems very scarce.

我只知道,我可以使用应用程序域做的是装载程序集在内存中,我可以卸载它们时,我想要的。

All I know that I can do with Application Domains is to load assemblies in memory and I can unload them when I want.

什么是我所提到的应用领域之外的能力?在线程尊重应用程序域的边界呢?有没有加载组件在不同的应用领域的任何缺点比​​超出通信性能的主要应用程序域等?

链接到讨论应用程序域将是很好的,以及资源。我已经签出MSDN其中没有关于他们的信息。

Links to resources that discuss Application Domains would be nice as well. I've already checked out MSDN which doesn't have that much information about them.

推荐答案

应用程序域最佳想像成一个重量很轻的过程。

AppDomains best visualized as a very light weight process.

可以有每净方法N的AppDomains但一般来讲,​​只有一个。 AppDomain中的真正优势是它们提供了你的进程内的隔离边界。对象只能通过远程或序列号的交谈,彼此相望一个AppDomain边界。

There can be N AppDomains per .Net Process but generally speaking there is only one. The real advantage of AppDomains is they provide an isolation boundary within your process. Objects can only talk to each other across an AppDomain boundary via remoting or serialization.

这也可以在过程中的完全不同的安全级别运行2的AppDomain。这可以让你在运行不受信任插件以低得多的信任级别运行在完全信任你的主要的应用程序。

It's also possible to run 2 AppDomains at completely different security levels within a process. This can allow you to run your main application at Full Trust while running Untrusted Plugins at a much lower trust level.

这很难咧说是或不是一个线程是否不尊重一个AppDomain。这是可能的一个线程在N个不同的应用程序域。这样的情况是可能的,如果在一个应用程序域的对象进行远程调用在另一个应用程序域的一个对象。该线程将具有以完成程序域之间进行转换。

It's hard to blanket say yes or no to whether or not a thread respects an AppDomain. It's possible for a single thread to be in N different AppDomains. Such a situation is possible if an object in one AppDomain makes a remote call to an object in another AppDomain. The thread will have to transition between the AppDomains in order to complete.

程序域的缺点,主要是复杂性。远程可以利用一点时间让你的头左右,并正确设置一个AppDomain可以是一个不平凡的过程。

The disadvantage of AppDomains is mainly complexity. Remoting can take a little bit of time to get your head around and properly setting up an AppDomain can be a non-trivial process.

您可能希望通过应用程序域MSDN文档采取偷看。很难找到一个sucint教程,介绍了他们,因为他们有各种复杂的功能。这提供了一个很好的概述它,如果它不回答你的问题,直接将至少指向你在正确的地方。

You may want to take a peek through the MSDN documentation on AppDomains. It's hard to find a sucint tutorial that describes them because they have a variety of complex features. This provides a nice overview which if it doesn't answer your question directly will at least point you in the right place.

<一个href="http://msdn.microsoft.com/en-us/library/cxk374d9.aspx">http://msdn.microsoft.com/en-us/library/cxk374d9.aspx

这篇关于我不明白的应用程序域的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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