Re: Questions about apartment threading models
- From: "Igor Tandetnik" <itandetnik@xxxxxxxx>
- Date: Wed, 11 Feb 2009 08:02:04 -0500
"Kürþat" <kursattheking@xxxxxxxxx> wrote in message
news:%23f$gbVEjJHA.4028@xxxxxxxxxxxxxxxxxxxx
I couldn't completely grasp meaning and usage of MTA and STA threading
models.
http://support.microsoft.com/kb/150777
1- Are the apartments only related to COM?
Yes.
2- Is there any apartment in a Win32 processes which never make any
COM call?
Apartments don't make COM calls - programs do. Of course there exist
Win32 programs that never make any COM calls - not even CoInitialize.
3- Is an apartment programatically creatable?
When a thread joins an apartment (by calling CoInitialize[Ex] or
OleInitialize) that didn't exist before, an appropriate apartment is
automatically created.
4- What is the role the apartments play in Win32 development, why do
they even exist?
To allow multi-threaded clients to safely access thread-unsafe COM
objects, and vice versa.
5- When and how does a pointer belong to an apartment?
Pointers don't belong to apartments - COM objects do. I guess one may
say that a pointer to an interface implemented by an object living in
some apartment belongs to that apartment.
--
With best wishes,
Igor Tandetnik
With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925
.
- Follow-Ups:
- Re: Questions about apartment threading models
- From: Kürşat
- Re: Questions about apartment threading models
- References:
- Questions about apartment threading models
- From: Kürşat
- Questions about apartment threading models
- Prev by Date: Questions about apartment threading models
- Next by Date: Re: Questions about apartment threading models
- Previous by thread: Questions about apartment threading models
- Next by thread: Re: Questions about apartment threading models
- Index(es):
Relevant Pages
|