关于.NET Process AppDomain NativeDll的问题!

FiLng 2003-07-22 04:18:22
If an assembly is used by multiple domains in a process, the assembly's code (but not its data) can be shared by all domains referencing the assembly. This reduces the amount of memory used at run time. This method of sharing an assembly's code is similar to the way in which the Microsoft Win32 API LoadLibrary shares code pages among processes that reference the same DLL. An assembly is said to be domain-neutral when its code can be shared by all domains in the process. The runtime host decides whether to load assemblies as domain-neutral when it loads the runtime into a process.

我的问题是:
如果我的.NET Process有两个AppDomain,其中一个AppDomain里的对象使用P/Invoke调用一个Native Dll里的函数,那这个Native Dll被加载到哪里?
调用者所在的AppDomain?
两个AppDomain之外与clr在同一unmanged区域?
...全文
53 6 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
qqchen79 2003-07-24
  • 打赏
  • 举报
回复
Native dlls have absolutely no idea about AppDomain. They are only loaded in processes. So any AppDomains in the same process will share the code of that native dll. And if there is any static data in the native dll, those data are also shared accross AppDomains.
FiLng 2003-07-24
  • 打赏
  • 举报
回复
thanks
saucer 2003-07-24
  • 打赏
  • 举报
回复
see the discussion in this post which might help you:

http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&selm=YcMaBCeSCHA.3072%40cpmsftngxa10
FiLng 2003-07-23
  • 打赏
  • 举报
回复
怎么没人理?
FiLng 2003-07-23
  • 打赏
  • 举报
回复
up
FiLng 2003-07-22
  • 打赏
  • 举报
回复
up!

111,092

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • AIGC Browser
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧