Re: Yet another _ATL_FREE_THREADED question
I think you have. Now for the million dollar question - what
improvement did you expect that you are not observing? If
you synchronize all method calls on a single mutex upon entry,
your server will not behave any faster than a single-threaded
server.
--
=====================================
Alexander Nickolov
Microsoft MVP [VC], MCSD
email: agnickolov@mvps.org
MVP VC FAQ: http://www.mvps.org/vcfaq
=====================================
"Dilip" <rdilipk@lycos.com> wrote in message
news:1150316768.433695.288310@i40g2000cwc.googlegroups.com...
Igor Tandetnik wrote:
Dilip <rdilipk@lycos.com> wrote:
Igor Tandetnik wrote:
Dilip <rdilipk@lycos.com> wrote:
I have a NT service that hosts a bunch of COM objects. I am in an
unenviable position of making it into a free threaded server.
Is there anything else I am missing?
Make sure you are calling CoIinitializeEx(COINIT_MULTITHREADED), and
not CoInitialize or CoIinitializeEx(COINIT_APARTMENTTHREADED)
You mean the __clients__ of the COM objects hosted inside the service?
No, the service itself.
OK -- I am using VS 2005 and I can see the thread being made to enter
MTA if _ATL_FREE_THREADED is defined. Maybe I am hallucinating -- I
will recheck anyway.
Also, since I am dealing with ATL wizard generated code, I assume when
_ATL_FREE_THREADED is defined the class objects are created by
automatically making the main thread enter a MTA?
At least in VC6, wizard-generated code generated an unconditional
CoInitialize() call, along with a comment saying that you need to
manually change it if you want to build free-threaded.
Ok -- this is definitely not the case with VC8.
So.. I have covered all bases then?