简体   繁体   English

同一AppDomain中MarshalByRefObject属性的性能

[英]Performance of MarshalByRefObject Attribute in the same AppDomain

I need to add the MarshalByRefObject attribute to some classes (that define the interface of a plug-in) to allow sandboxing of these plug-ins. 我需要将MarshalByRefObject属性添加到某些类(用于定义插件的接口),以允许对这些插件进行沙盒处理。 These classes are also used in a "non-plugin" context in a completely different application, but the attributes are in code. 这些类还在完全不同的应用程序的“非插件”上下文中使用,但是属性在代码中。 Do I will have any performance penalties in this other application without extra AppDomains? 如果没有额外的AppDomain,我是否会对其他应用程序产生任何性能损失?

You should have no major performance impact, if it is being called from the same AppDomain none of the methods of MarshalByRefObject will be called. 如果从同一AppDomain调用它,则不会对性能产生重大影响,不会调用MarshalByRefObject任何方法。

If there was a major impact than WinForms would be in a lot of trouble considering Control derives from MarshalByRefObject 如果产生重大影响,则考虑到Control衍生自MarshalByRefObject WinForms将遇到很多麻烦

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM