com - COINIT_SPEED_OVER_MEMORY 有什么作用?

标签 com

打电话时CoInitializeEx ,您可以为 dwCoInit 指定以下值:

typedef enum tagCOINIT {
    COINIT_MULTITHREADED     = 0x0,
    COINIT_APARTMENTTHREADED = 0x2,
    COINIT_DISABLE_OLE1DDE   = 0x4,
    COINIT_SPEED_OVER_MEMORY = 0x8,
} COINIT;

暗示性标题为“内存速度”值的作用是什么?这些天在 COM 中被忽略了吗?

最佳答案

不知道它是否仍在使用,但它旨在改变 COM 算法使用的平衡。

如果您有大量内存并且不惜一切代价想要速度,您可以设置该标志。

在低内存环境中,关闭该标志将有利于减少内存使用。

事实证明,奇妙的Raymond Chen ("The Old New Thing" 名望)现在已经对这个主题进行了权衡,尽管这面旗帜的意图是什么,它显然什么也没做。

What does the COINIT_SPEED_OVER_MEMORY flag to CoInitializeEx do?更多细节:

When should you enable this mode? It doesn't matter, because as far as I can tell, there is no code anywhere in COM that changes its behavior based on whether the process has been placed into this mode! It looks like the flag was added when DCOM was introduced, but it never got hooked up to anything. (Or whatever code that had been hooked up to it never shipped.)



还有 http://archives.neohapsis.com/archives/microsoft/various/dcom/2001-q1/0160.html来自 Steve Swartz,最初的 COM+ 架构师之一:

COINIT_SPEED_OVER_MEMORY is ignored by COM.

关于com - COINIT_SPEED_OVER_MEMORY 有什么作用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/80160/

相关文章:

.net - 对 IID_ICorProfilerInfo 的引用失败

c# - 使用 c# 运行带有 activex 对象的 dll

c# - 如何将 C++ 中的 bool 数组编码(marshal)到 C# 中的 bool 数组

c++ - 通过以下两种方式分配指针对象有什么区别?

c# - 如何获取有关 IDispatch COM 接口(interface)故障的更多调试信息

.net - .NET 是否使原始 COM 和 DCOM 编程变得多余?

COM:如何处理特定的异常?

c# - 想要在部署的机器上使用 COM dll 文件而不注册 dll 文件

c++ - 调用 ConnectDirect() MSFT API 时出现错误 "The owner SID on a per-user subscription doesn' t 存在于 DXVA2 中,但不存在于 DXVAHD 中。

c# - 2个应用程序之间的进程间通信