系统中的dll进程?
我对内存中的dll加载和处理有疑问,通常dll是共享库,所以dll应该加载一次就足够了。如果一个进程将一个dll(例如advapi32.dll)加载到内存中意味着,之后另一个进程如何引用advapi32 .dll 到该进程...如何共享每个进程的公共位置...
i have a doubt in dlls loading &processing in memory ,normally dlls are shared library so dll should loads once is enough.if a process loads a dll (ex.advapi32.dll )into memory means ,after that another process how refers advapi32.dll to that process ...how can share common location for each process...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不完全确定你的问题是什么,但是,是的,如果多个进程导入同一个 DLL,那么该 DLL 的只读部分通常会映射到所有这些进程。另一方面,可以更改的部分,如 BSS(变量)段,在每个进程中获取一个副本,以便一个进程所做的更改对于其他进程来说是不可见的。如果您希望在自己的 DLL 的进程之间共享某些更改,则可以将 DLL 中的数据部分标记为共享。具体如何执行此操作取决于您使用的开发工具。
I'm not entirely sure what your question is, but yes, if multiple processes import the same DLL, then the read-only sections of that DLL are typically mapped into all of those processes. On the other hand, section that can change, like the BSS (variable) segment, get a copy in each process so that the changes that one process makes are invisible to other processes. If you want certain changes to be shared between processes for your own DLL, you can mark a data section in the DLL as shared. Exactly how you do this depends on the development tools you're using.