Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

What are STA And MTA in threading?

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


Please Help Members By Posting Answers For Below Questions

How big is a float?

860


What is continue in c#?

927


What is mean by c#?

874


Where static variables are stored?

880


What is the difference between an integer and int?

851


Explain how do you directly call a native function exported from a dll?

875


What is parallel foreach c#?

899


State the top.NET class that everything is derived from?

885


Which of these statements correctly declares a two-dimensional array in c#?

1010


Is dll a library?

863


What is hashtable c#?

804


What is the purpose of abstract class in c#?

868


What is a verbatim string literal and why do we use it?

894


What does || mean in programming?

894


What are extensions in c#?

913