Free Thread marshaller 
Author Message
 Free Thread marshaller

I was looking for some documentation on the Free Threaded Marshaller.
Besides checking the box in the ATL wizard, what else is required ?
Information like this etc

Any suggestions

Donald



Sun, 06 Mar 2005 11:36:50 GMT  
 Free Thread marshaller
Your object becomes apartment-neutral. The implication is you
must store all interface pointers in the GIT and access them on
demand only. You cannot have any thread affinity (no windows,
no TLS, etc), _and_ you cannot block (no WaitForXXX calls). You
get all the limitations of STA and MTA together. The advantage
is no marshaling penalty in the same process - always direct
calls. Good for low level objects. DirectDraw is an example.
Note also you must use ThreadingModel=Both.

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

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

Quote:

> I was looking for some documentation on the Free Threaded Marshaller.
> Besides checking the box in the ATL wizard, what else is required ?
> Information like this etc

> Any suggestions

> Donald



Mon, 07 Mar 2005 02:32:37 GMT  
 Free Thread marshaller
Thanks

You mentioned about storing off interface pointers in the GIT.  This I am
assuming you mean if I want to hold a interface pointer as member of a
class.   what about objects (COM) that are created on demand.  Meaning
created in a method call but released when the call is complete ?  Is there
anything special I need to do.


Your object becomes apartment-neutral. The implication is you
must store all interface pointers in the GIT and access them on
demand only. You cannot have any thread affinity (no windows,
no TLS, etc), _and_ you cannot block (no WaitForXXX calls). You
get all the limitations of STA and MTA together. The advantage
is no marshaling penalty in the same process - always direct
calls. Good for low level objects. DirectDraw is an example.
Note also you must use ThreadingModel=Both.

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

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


Quote:
> I was looking for some documentation on the Free Threaded Marshaller.
> Besides checking the box in the ATL wizard, what else is required ?
> Information like this etc

> Any suggestions

> Donald



Tue, 08 Mar 2005 23:06:59 GMT  
 Free Thread marshaller
Those are fine. A method call completely executes on a single thread, so
as long as you don't keep the pointer after the method returns, you can
use it normally.
--
With best wishes,
    Igor Tandetnik

"For every complex problem, there is a solution that is simple, neat,
and wrong." H.L. Mencken


Quote:
> Thanks

> You mentioned about storing off interface pointers in the GIT.  This I
am
> assuming you mean if I want to hold a interface pointer as member of a
> class.   what about objects (COM) that are created on demand.  Meaning
> created in a method call but released when the call is complete ?  Is
there
> anything special I need to do.



> Your object becomes apartment-neutral. The implication is you
> must store all interface pointers in the GIT and access them on
> demand only. You cannot have any thread affinity (no windows,
> no TLS, etc), _and_ you cannot block (no WaitForXXX calls). You
> get all the limitations of STA and MTA together. The advantage
> is no marshaling penalty in the same process - always direct
> calls. Good for low level objects. DirectDraw is an example.
> Note also you must use ThreadingModel=Both.

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

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



> > I was looking for some documentation on the Free Threaded
Marshaller.
> > Besides checking the box in the ATL wizard, what else is required ?
> > Information like this etc

> > Any suggestions

> > Donald



Wed, 09 Mar 2005 03:50:52 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Free threaded outof proc server and Single threaded components

2. A doubt about Threads in Free Threaded components

3. Free threaded vs. apartment threaded

4. Thread termination in free threaded DCOM server

5. how to write a custom marshaller?

6. Ole Automation Marshaller

7. freeing handles, GC, and threading .... please help

8. Flicker free updating listview from threads??

9. Free threaded server ....

10. free threading com server

11. Free-threaded DCOM server conflicts with MSAccess driver's use of OleInitialize

12. free threading on ATL

 

 
Powered by phpBB® Forum Software