What is the difference between STA and MTA?

Answers were Sorted based on User's Feedback



What is the difference between STA and MTA?..

Answer / 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

What is the difference between STA and MTA?..

Answer / praveen

Apartment Threading (STA): This allows multiple threads to
exist in a single application. In single threading
apartment (STA), each thread is isolated in it?s own
apartment. The process may contain multiple threads
(apartments) however when an object is created in a thread
(i.e. apartment) it stays within that apartment. If any
communication needs to occur between different threads
(i.e. different apartments) then we must marshal the first
thread object to the second thread.

Is This Answer Correct ?    14 Yes 7 No

What is the difference between STA and MTA?..

Answer / umarali

STA:

1.STA stands for Single Threaded Apartment
2.In STA,there may be multiple apartment.But only single
thread can be executed in a apartment.
3.In STA, if there is a need to communicate between threads
we need a proxy, they can not do it directly.
4.MTA applications execute slower than STA
5.If the COM object cannot handle its own synchronization
i.e not thread safe then the STA model can be used

MTA:

1.MTA stands for Multi Threaded Apartment
2.In MTA, only one apartment will be there and all threads
will execute within that single apartment.
3.In MTA, threads communicate directly to each other without
a proxy.
4.MTA applications typically execute faster than STA because
there is less system overhead and can be optimized to
eliminate system idle time.
5.If the COM object can handle its own synchronization then
the MTA model can be used

Is This Answer Correct ?    2 Yes 3 No

Post New Answer

More Dot Net Framework Interview Questions

if u add an import stmt to an application u can do the same by adding reference to the apllication then what is the diff bet these two ?

1 Answers  


Can you draw and explain the .NET Farmework?

2 Answers   Bosch,


What is strong name?

5 Answers  


What is the use of web api ? Why web api needed, if you have already restful services using wcf ?

0 Answers  


what is MVC pattern?

2 Answers  






exe abrevatiom

5 Answers   IBM,


Explain what is the difference between view and partial view?

0 Answers  


How does the .net framework 3.0 relate to the .net framework 2.0?

0 Answers  


Explain the tools used for unit testing in ASP.Net MVC

0 Answers   B-Ways TecnoSoft,


Microsoft introduced c# as a de facto language of the .NET platform. What is mean by de facto and fot what purpose? Please answer me. Advance thanks.

3 Answers   Excel,


Can two application one using private assembly and other using Shared assembly be stated as a side-by-side executables?

1 Answers  


Which is the institute which also caters to your personal development other than subject.

1 Answers   TCS,


Categories