Answer Posted / 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 |
Post New Answer View All Answers
What is the difference between finally and finalize block?
What is access specifier in c#?
How can I get the ascii code for a character in c#?
Define delay signing?
How would you describe encapsulation in c#?
If I want to override a method one of class A and in class b then how do you declare?
How do you comment out code in c#?
Why use “using” in c#?
What do you mean by string objects are immutable?
How to implement an object pool in c#.net.
How do I use the 'using' keyword with multiple objects?
What is the use of console readline () in c#?
How Reflection is used and what it's significance ?
How to use delegates with events?
Does c# do array bounds checking?