What is a .NET Application Domain?

倾然丶 夕夏残阳落幕 提交于 2019-12-08 16:33:24

问题


What is exactly is an Application Domain (AppDomain) and how is it different than a process or thread?


回答1:


See MSDN.

Application domains provide a more secure and versatile unit of processing that the common language runtime can use to provide isolation between applications. You can run several application domains in a single process with the same level of isolation that would exist in separate processes, but without incurring the additional overhead of making cross-process calls or switching between processes. The ability to run multiple applications within a single process dramatically increases server scalability.

An AppDomain is basically an isolated execution environment for managed code.




回答2:


An application domain is the "space" segments of code can run in. It can be used for a couple of things such as creating a sandbox when loading assemblies that you don't fully trust. It's different than a thread/process in that it houses the code that is being executed instead of actually being executed code. In a broad sense you can think of any application as an application domain.



来源:https://stackoverflow.com/questions/2368519/what-is-a-net-application-domain

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!