Re: Unified Event Model and support for multithreaded usage
My guess would be that the generated code is thread safe - e.g.
it uses critical sections.
Note that attributed ATL is deprecated in the next release of
VC - VC 9.0 part of VS 2008 due later this month. It contains
bugs in the generated code (specifically events cause memory
leaks IIRC) in the previous releases of VC.
--
=====================================
Alexander Nickolov
Microsoft MVP [VC], MCSD
email: agnickolov@mvps.org
MVP VC FAQ: http://vcfaq.mvps.org
=====================================
"Boris" <boris@gtemail.net> wrote in message
news:op.t1hprm0x45fww6@burk.mshome.net...
On Thu, 08 Nov 2007 01:16:04 +0200, Boris <boris@gtemail.net> wrote:
I stumbled over the following sentence (which refers to the Unified
Event Model) on
http://msdn2.microsoft.com/en-us/library/aa984511(VS.71).aspx:
"The model supports single- and multithreaded usage and protects data
from simultaneous multithread access."
Does anyone know what "supports multithreaded usage" means exactly? Does
it refer to MTA threads only? Or (it would be too nice) does it also
mean that you can fire an event in a worker thread which might be in
another apartment (without doing any marshaling yourself)?
Looking at the code which is injected by VS2005 it seems like firing
events from a worker thread is *not* supported: I see no marshaling nor
IGlobalInterfaceTable. What I see though is code which according to
http://support.microsoft.com/kb/280512/en-us needs to be replaced to make
firing events from worker threads possible.
Boris