What are STA And MTA in threading?
Answers were Sorted based on User's Feedback
Answer / kiran kumar reddy
The Thread will create and enter a multi threaded apartment.
The Thread will create and enter a Single threaded apartment.
An apartment is a logical container within a process for
objects sharing the same thread access requirements. All
objects in the same apartment can receive calls from any
thread in the apartment. The .NET Framework does not use
apartments, and managed objects are responsible for using
all shared resources in a thread-safe manner themselves.
Because COM classes use apartments, the common language
runtime needs to create and initialize an apartment when
calling a COM object in a COM interop situation. A managed
thread can create and enter a single-threaded apartment
(STA) that allows only one thread, or a multithreaded
apartment (MTA) that contains one or more threads. You can
control the type of apartment created by setting the
ApartmentState property of the thread to one of the values
of the ApartmentState enumeration. Because a given thread
can only initialize a COM apartment once, you cannot change
the apartment type after the first call to the unmanaged code.
| Is This Answer Correct ? | 13 Yes | 8 No |
Answer / guest
Mahesh, An Advice for you
LEAVE SOFTWARE DEVELOPMENT LINE
| Is This Answer Correct ? | 7 Yes | 2 No |
Answer / mahesh chandra
Single Threaded Apartment and Multy Threaded Apartment
| Is This Answer Correct ? | 1 Yes | 18 No |
What are satellite assemblies? How will you get the different language strings?
Is int a class in c#?
Wcf and what is difference between wcf and web services?
Which is faster iqueryable or ienumerable?
Why do we use overloading in c#?
How does return work in c#?
What is the difference between a field and a property in c#?
What is a Assembly?
What is unmannaged code and will CLR handle this kind of code or not .
What are boxing and unboxing?
What is Interface and Abstraction (in real time scenario)
I have a class declared as below public class a { public void add() {} } What is the diference between a a1 =new a; and simply a a1;
Visual Basic (800)
C Sharp (3816)
ASP.NET (3180)
VB.NET (461)
COM+ (79)
ADO.NET (717)
IIS (369)
MTS (11)
Crystal Reports (81)
BizTalk (89)
Dot Net (2435)
Exchange Server (362)
SharePoint (720)
WCF (340)
MS Office Microsoft (6963)
LINQ Language-Integrated Query (317)
WPF (371)
TypeScript (144)
Microsoft Related AllOther (311)