When calling CoInitializeEx
, you can specify the following values for dwCoInit
:
typedef enum tagCOINIT {
COINIT_MULTITHREADED = 0x0,
COINIT_APARTMENTTHREADED = 0x2,
COINIT_DISABLE_OLE1DDE = 0x4,
COINIT_SPEED_OVER_MEMORY = 0x8,
} COINIT;
What does the suggestively titled "speed over memory" value do? Is it ignored these days in COM?
No idea if it's still used but it was meant to change the balance used by the COM algorithms.
If you had tons of memory and wanted speed at all costs, you would set that flag.
In low-memory environments, leaving that flag off would favor reduced memory usage.
As it turns out, the marvellous Raymond Chen (of "The Old New Thing" fame) has now weighed in on the subject and, despite what that flag was meant to do, it apparently does nothing at all.
See What does the COINIT_SPEED_OVER_MEMORY flag to CoInitializeEx do? for more details:
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.)
Also http://archives.neohapsis.com/archives/microsoft/various/dcom/2001-q1/0160.html from Steve Swartz, one of the original COM+ architects:
COINIT_SPEED_OVER_MEMORY is ignored by COM.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With