Hi,

as I mentioned in my previous mail, I have it running with my application.
I have done the code changes Jim is describing in his mail and additionally
removed the line
#define _ATL_APARTMENT_THREADED
from src\com\stdafx.h

Is it possible to get this changes to the common Xerces code?
If the COM binding supports both threading models it's a real replacement
for the MSXML DOM parser.

I can't use the V1.60 COM binding and only change manually the threading
model
registry setting, because I use the XML parser in the interface of a
MTA DCOM Server. One parser object is used from different threads.

Tom

----- Original Message -----
From: "Murphy, James" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, January 07, 2002 4:47 PM
Subject: RE: COM Threading Model of COM binding (xerces-com)


> I haven't ever used Xerces COM but that wont stop my from wild
speculation!
>
> I don't see any reason why it can't live in the MTA.  One of the cool
things
> about Xerces COM is the ability to access Xerces form COM aware scripting
> languages.  These environments usually like STA components since they are
> single threaded.  Creating the parser in the MTA would cause it to exist
in
> another apartment and incur the overhead of inter-apartment marshaling.
> But, it doesn't explain why it couldn't be registered to support both
> threading models.
>
> All the COM wrapper classes inherit from:
> CComObjectRootEx<CComSingleThreadModel>
>
> but if they were re-written to inherit from:
> CComObjectRootEx<CComMultiThreadModel>
>
> and the rgs scripts were changed you would be in business.  I wonder what
> manually modifying the registry entry from 'Apartment' to 'both' would do?
> Provided you only used a parser on its creating thread I bet you wouldn't
> have a problem.  Ugly I know but worth the experiment?
>
> Jim
>
> > -----Original Message-----
> > From: Thomas Rummel [mailto:[EMAIL PROTECTED]]
> > Sent: Monday, January 07, 2002 3:55 AM
> > To: [EMAIL PROTECTED]
> > Subject: COM Threading Model of COM binding (xerces-com)
> >
> >
> > Hi,
> >
> > I'm want to use the Xerces COM wrapper (xerces-com) as
> > replacement for the
> > MSXML parser.
> > During my tests I encoutered difficulties with the COM
> > threading model used
> > by xerces-com.
> >
> > xerces-com supports only appartment threaded applications
> > (COM STA) but
> > MSXML supports
> > free and appartment threaded applications (COM STA and COM
> > MTA). This leads
> > to a
> > very bad performance if xerces-com is used in an COM MTA
> > application like in
> > my case
> > (each method call causes a marshaling between to threads of the
> > application).
> >
> > Does someone know the reason for the "only COM STA" restriction?
> >
> > I've made some minor changes to get xerces-com running in a
> > COM MTA thread
> > without
> > marshaling. With my application this xerces-com seems to work
> > without any
> > problem.
> >
> > Thanks, Tom
> >



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to