What is the difference between STA and MTA?

Answer Posted / prabhu

In single threaded apartment (STA) each thread is isolated
in a separate apartment underneath the process. The process
can have any number of apartments that share data through a
proxy. The application defines when and for how long the
thread in each apartment should execute. All requests are
serialized through the Windows message queue such that only
a single apartment is accessed at a time and thus only a
single thread will be executing at any one time. STA is the
threading model that most Visual Basic developers are
familiar with because this is the threading model available
to VB applications prior to VB.NET. You can think of it
like an apartment building full of a row of one room
apartments that are accessible one at a time through a
single hallway. The advantage this provides over single
threaded is that multiple commands can be issued at one
time instead of just a single command, but the commands are
still sequentially executed.


The free threaded/Multi Threaded Apartment (MTA) model has
a single apartment created underneath the process rather
than multiple apartments. This single apartment holds
multiple threads rather than just a single thread. No
message queue is required because all of the threads are a
part of the same apartment and can share data without a
proxy. You can think of it like a building with multiple
rooms that are all accessible once you are inside the
building. These applications typically execute faster than
single threaded and STA because there is less system
overhead and can be optimized to eliminate system idle
time.

Is This Answer Correct ?    32 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What operating systems will the .net framework 3.0 be available for?

664


What are the 3 segments of the default route, that is present in an ASP.NET MVC application?

690


Is it possible to unit test an mvc application without running the controllers in an asp.net process?

725


What does mvvm mean?

651


What is the use .Glimpse in ASP.Net MVC

667






How does work clr?

625


How to use multiple submit buttons in asp.net mvc?

694


what is split entity?

702


i want to take the fast track training on >net Frame work and work flows and share point could you tellme the good institutes for that cources

1677


What are the main components of .net framework?

651


What is the role of the jit compiler in .net framework?

745


What is rxjava used for?

762


What is objectset? : Entity framework

651


What symbol would you use to denote, the start of a code block in razor views?

658


What is routeconfig.cs in mvc 4?

766