Re: CoInitializeEx and MTA



"George" <George@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:2C7066B7-65D7-44F8-A8A8-BE08ECEC0B6D@xxxxxxxxxxxxx
Suppose there are a couple of threads in an MTA, since a process
could have only one MTA, I think,

1. Even if each threads calls CoInitializeEx or CoInitialize, only
the first call allocates COM related resources, all subsequent calls
does not allocate any resources?

Correct.

2. Only the last call to CoUninitialize frees the COM resources in
the MTA, and at that time, the MTA terminates?

There are per-thread resources, too. CoUninitialize in a thread frees
resources allocated for this thread when it leaves MTA apartment. It is
correct that the apartment is destroyed when the last thread leaves it.
--
With best wishes,
Igor Tandetnik

With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925


.



Relevant Pages

  • How GC Works
    ... one contains the memory part and other manages the ... unmanaged resources and implement finalize in the second class so that ... allocates large memory as classes implementing finalize method requires ... Sub New ...
    (microsoft.public.dotnet.framework.clr)
  • Garbage Collection
    ... one contains the memory part and other manages the ... unmanaged resources and implement finalize in the second class so that ... allocates large memory as classes implementing finalize method requires ... Sub New ...
    (microsoft.public.dotnet.framework.clr)
  • Re: Unmanaged resources
    ... unmnaged resources needs to be manually disposed. ... Any object that allocates unamanaged resources must also free them, ... general rule is that if you use an object that implements Dispose, ... What happens in the Dll stays in the Dll (generally anyway, ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: Boot panic w/7.2-STABLE on amd64: resource_list_alloc
    ... allocates the resources once for each channel it seems in the ata_ali_sata attachment. ... all the other chipsets are good about allocating these resources in their chipinit routines rather than the per-channel allocate routine. ... It uses allocation functions wrapped by the atapci "bus", so every channel uses it's own pair of RIDs. ... Is there any other way to correctly handle two halves of same resource separately without teaching atapci to virtualize this as interrupts or handle it on controller level? ...
    (freebsd-stable)
  • Re: MTA
    ... Exim gives you control over the resources it uses. ... postfix has features like that ... ... But an MTA can monitor these and adjust ... To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx ...
    (Debian-User)