What is STA

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: kimi (daniel2oversea_at_hotmail.com)
Date: 08/30/04


Date: Mon, 30 Aug 2004 17:43:54 +0800

I just start read the Apartment types, and get lots of questions about it.
Why we should use STA or MTA? What is the relationship of STA , threads and
COM? How the message queue synchronize the COM method calling?



Relevant Pages

  • Re: STAThread weglassen?
    ... STA und MTA definieren, wie eine COM-Komponente ... in jedem STA ist genau ein Thread. ... ein Objekt im Thread des Hauptfensters werden von COM gemanaged ...
    (microsoft.public.de.german.entwickler.dotnet.csharp)
  • Re: .NET Assemblies vs. COM DLL
    ... type of apartment that they require because this also describes their ... An STA object has no thread synchronization in its code and therefore it ... of threads that will run in the MTA. ... > Any insight into the compile and run time differences between a COM ...
    (microsoft.public.dotnet.general)
  • Re: difference between STA and MTA
    ... Apartment - the objects will be created in an STA ... Both - the object will be created in the apartment of the thread that creates the object (STA or MTA) ... the object is created in the threads STA, there is no marshalling and all calls to the object are made on the STA thread. ...
    (microsoft.public.dotnet.languages.csharp)
  • Cross apartment COM interface call without type library in C#?
    ... There is NO TYPE LIBRARY registered for this interface. ... If I create such object in native C++ (CoCreateInstance) no matter if on MTA or STA thread, I obtain direct pointer to the IMyInterface interface without any proxy, right? ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: CoUninitialize hang after mixing neutral and free objects
    ... an MTA to TNA boundary is faster than say, an MTA to STA boundary. ... there is no thread context switch, there aren't the security issues that are ... problematic with transversing an MTA to STA boundary; in other words, a TNA ...
    (microsoft.public.vc.atl)