Threading Model of MTS-based ATL components 
Author Message
 Threading Model of MTS-based ATL components

Hi all!

Sorry for posting again. I urgently need an answer to my problem:

I wanted to know the default threading model only for those ATL that create
MTS objects.
The cause of confusion are the following lines of code that are written
after creating an
MTS component through the ATL COM AppWizard:

    val ThreadingModel = s 'Both'   (in the Registrar Script Code .RGS file)
and
     public CComObjectRootEx<CComSingleThreadModel>,     (in the Class
declarations)
and then
    #define _ATL_APARTMENT_THREADED       (in the  StdAfx.h file)

Though I will not be using COM+ but I need to make sure what threading model
is being used, as well as what is
the best threading model in this regard. I would greatly appreciate if you
could also suggest the best way to port
the existing code into using the new threading model.

Thanx in advance.

Nadeem Rauf


Quote:
> Are you asking what the _best_ threading model would be? Or what is the
> deafult?
> The default in ATL is STA objects. If you want to take advantage of
pooling
> (MTS, COM+) you'll need to create TNA objects that aggregate the FTM.

> --
> Assaf Lavie.



> > Hi guys!

> > Can anybody please tell me what is the default threading model while
> > creating an MTS component
> > through C++ ATL COM AppWizard?

> > Is that the best threading model to pull XML from a site, transform and
> then
> > spit onto a web page?
> > Also if I need to optimize the component any further, what steps would
be
> > needed?

> > Thanx in advance.

> > Nadeem Rauf



Tue, 01 Jul 2003 00:38:13 GMT  
 Threading Model of MTS-based ATL components
In MTS that makes sense. Your object is never going to be called on
multiple threads at the same time, therefore thread synchronization
is redundant. Just keep in mind it cannot be used outside of MTS
this way (especially by MTA clients)...

--
=====================================
Alexander Nickolov
Microsoft MVP [VC], MCSD

MVP VC FAQ: http://www.mvps.org/vcfaq
=====================================


Quote:
> Hi all!

> Sorry for posting again. I urgently need an answer to my problem:

> I wanted to know the default threading model only for those ATL that
create
> MTS objects.
> The cause of confusion are the following lines of code that are written
> after creating an
> MTS component through the ATL COM AppWizard:

>     val ThreadingModel = s 'Both'   (in the Registrar Script Code .RGS
file)
> and
>      public CComObjectRootEx<CComSingleThreadModel>,     (in the Class
> declarations)
> and then
>     #define _ATL_APARTMENT_THREADED       (in the  StdAfx.h file)

> Though I will not be using COM+ but I need to make sure what threading
model
> is being used, as well as what is
> the best threading model in this regard. I would greatly appreciate if you
> could also suggest the best way to port
> the existing code into using the new threading model.

> Thanx in advance.

> Nadeem Rauf



> > Are you asking what the _best_ threading model would be? Or what is the
> > deafult?
> > The default in ATL is STA objects. If you want to take advantage of
> pooling
> > (MTS, COM+) you'll need to create TNA objects that aggregate the FTM.

> > --
> > Assaf Lavie.



> > > Hi guys!

> > > Can anybody please tell me what is the default threading model while
> > > creating an MTS component
> > > through C++ ATL COM AppWizard?

> > > Is that the best threading model to pull XML from a site, transform
and
> > then
> > > spit onto a web page?
> > > Also if I need to optimize the component any further, what steps would
> be
> > > needed?

> > > Thanx in advance.

> > > Nadeem Rauf



Tue, 01 Jul 2003 08:15:45 GMT  
 Threading Model of MTS-based ATL components
Ok I am a little confused here so I'll re-state my question:

When you create an MTS object using the ATL wizard,
what is the threading model for this component since the
wizard does not ask for a threading model.

Thanks,
Nadeem Rauf.


Quote:
> In MTS that makes sense. Your object is never going to be called on
> multiple threads at the same time, therefore thread synchronization
> is redundant. Just keep in mind it cannot be used outside of MTS
> this way (especially by MTA clients)...

> --
> =====================================
> Alexander Nickolov
> Microsoft MVP [VC], MCSD

> MVP VC FAQ: http://www.mvps.org/vcfaq
> =====================================



> > Hi all!

> > Sorry for posting again. I urgently need an answer to my problem:

> > I wanted to know the default threading model only for those ATL that
> create
> > MTS objects.
> > The cause of confusion are the following lines of code that are written
> > after creating an
> > MTS component through the ATL COM AppWizard:

> >     val ThreadingModel = s 'Both'   (in the Registrar Script Code .RGS
> file)
> > and
> >      public CComObjectRootEx<CComSingleThreadModel>,     (in the Class
> > declarations)
> > and then
> >     #define _ATL_APARTMENT_THREADED       (in the  StdAfx.h file)

> > Though I will not be using COM+ but I need to make sure what threading
> model
> > is being used, as well as what is
> > the best threading model in this regard. I would greatly appreciate if
you
> > could also suggest the best way to port
> > the existing code into using the new threading model.

> > Thanx in advance.

> > Nadeem Rauf



> > > Are you asking what the _best_ threading model would be? Or what is
the
> > > deafult?
> > > The default in ATL is STA objects. If you want to take advantage of
> > pooling
> > > (MTS, COM+) you'll need to create TNA objects that aggregate the FTM.

> > > --
> > > Assaf Lavie.



> > > > Hi guys!

> > > > Can anybody please tell me what is the default threading model while
> > > > creating an MTS component
> > > > through C++ ATL COM AppWizard?

> > > > Is that the best threading model to pull XML from a site, transform
> and
> > > then
> > > > spit onto a web page?
> > > > Also if I need to optimize the component any further, what steps
would
> > be
> > > > needed?

> > > > Thanx in advance.

> > > > Nadeem Rauf



Tue, 01 Jul 2003 22:17:48 GMT  
 Threading Model of MTS-based ATL components
It was in your post - Both.

--
=====================================
Alexander Nickolov
Microsoft MVP [VC], MCSD

MVP VC FAQ: http://www.mvps.org/vcfaq
=====================================


Quote:
> Ok I am a little confused here so I'll re-state my question:

> When you create an MTS object using the ATL wizard,
> what is the threading model for this component since the
> wizard does not ask for a threading model.

> Thanks,
> Nadeem Rauf.



> > In MTS that makes sense. Your object is never going to be called on
> > multiple threads at the same time, therefore thread synchronization
> > is redundant. Just keep in mind it cannot be used outside of MTS
> > this way (especially by MTA clients)...

> > --
> > =====================================
> > Alexander Nickolov
> > Microsoft MVP [VC], MCSD

> > MVP VC FAQ: http://www.mvps.org/vcfaq
> > =====================================



> > > Hi all!

> > > Sorry for posting again. I urgently need an answer to my problem:

> > > I wanted to know the default threading model only for those ATL that
> > create
> > > MTS objects.
> > > The cause of confusion are the following lines of code that are
written
> > > after creating an
> > > MTS component through the ATL COM AppWizard:

> > >     val ThreadingModel = s 'Both'   (in the Registrar Script Code .RGS
> > file)
> > > and
> > >      public CComObjectRootEx<CComSingleThreadModel>,     (in the Class
> > > declarations)
> > > and then
> > >     #define _ATL_APARTMENT_THREADED       (in the  StdAfx.h file)

> > > Though I will not be using COM+ but I need to make sure what threading
> > model
> > > is being used, as well as what is
> > > the best threading model in this regard. I would greatly appreciate if
> you
> > > could also suggest the best way to port
> > > the existing code into using the new threading model.

> > > Thanx in advance.

> > > Nadeem Rauf



> > > > Are you asking what the _best_ threading model would be? Or what is
> the
> > > > deafult?
> > > > The default in ATL is STA objects. If you want to take advantage of
> > > pooling
> > > > (MTS, COM+) you'll need to create TNA objects that aggregate the
FTM.

> > > > --
> > > > Assaf Lavie.



> > > > > Hi guys!

> > > > > Can anybody please tell me what is the default threading model
while
> > > > > creating an MTS component
> > > > > through C++ ATL COM AppWizard?

> > > > > Is that the best threading model to pull XML from a site,
transform
> > and
> > > > then
> > > > > spit onto a web page?
> > > > > Also if I need to optimize the component any further, what steps
> would
> > > be
> > > > > needed?

> > > > > Thanx in advance.

> > > > > Nadeem Rauf



Wed, 02 Jul 2003 05:56:43 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Threading model for MTS components

2. what threading model is default when no Threading model key

3. ATL-based MTS object

4. ATL-based MTS objects/Part 2

5. Threading model of a component

6. About apartment thread model in ASP component..

7. About apartment thread model in ASP component..

8. CSocket problem with an Apartment threading model component !

9. free threaded ATL, MTS, ADO problem

10. VC++ 7 /ATL 7 server threading model

11. ATL Threading model

12. ATL threading model

 

 
Powered by phpBB® Forum Software