Re: CoInitializeEx and MTA



"George" <George@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:165B66C4-BDD8-41E8-A94B-BA7B85800F34@xxxxxxxxxxxxx
There are per-thread resources, too. CoUninitialize in a thread frees
resources allocated for this thread when it leaves MTA apartment.

I am confused. In point 1 of the question, you think it is correct
that no resource is allocated from the 2nd call to CoInitializeEx.

I meant second call on the same thread. It either fails, or returns
S_FALSE and does nothing (except incrementing some internal counter).

Every thread that wants to use COM must call CoInitialize[Ex]. The first
such call (the first for the calling thread, not for the apartment or
for the process) returns S_OK and allocates per-thread resources.
--
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)