Saturday, 15 August 2015

.net - Could you explain STA and MTA? -



.net - Could you explain STA and MTA? -

can explain sta , mta in own words?

also, flat threads , pertain com? if so, why?

the com threading model called "apartment" model, execution context of initialized com objects associated either single thread (single thread apartment) or many threads (multi thread apartment). in model, com object, 1 time initialized in apartment, part of flat duration of it's runtime.

the sta model used com objects not thread safe. means not handle own synchronization. mutual utilize of ui component. if thread needs interact object (such pushing button in form) message marshalled onto sta thread. windows forms message pumping scheme illustration of this.

if com object can handle own synchronization mta model can used multiple threads allowed interact object without marshalled calls.

.net multithreading com apartments

No comments:

Post a Comment