No it has not been tested in a multi-threaded environment. Can you recommend
"John Saunders [MVP]" wrote:
> "chriscap" <chriscap@discussions.microsoft.com> wrote in message
> news:A1E06E10-AA27-4810-85F4-DEFB607FC487@microsoft.com...
> >I tried searching the forums for this already and didn't find anything. I
> > want to expose functionality from a vb6 COM component via a WCF service.
> > I
> > am trying to evaluate if exposing this webservice and using a COM
> > component
> > is scalable. I have heard there are problems with this revolving around
> > the
> > apartment threading models.
> >
> > I know COM dll's are STA and a WCF service is MTA. Since there is no way
> > to
> > force a WCF service to be STA, I am expecting all my webservice calls to
> > block as they are forced through the STA pipe. However, this is not
> > happening and I am wondering why. To test, I have a web method that takes
> > a
> > boolean parameter. the web method calls some functions from the COM
> > component and then if the parameter is true, it pauses the current thread,
> > otherwise it doesn't. I have two clients that hit the service at the same
> > time and while one is paused the other is constantly hitting the service.
> > I
> > am expecting the second client to block while first one is paused. Can
> > anyone tell me why this isn't happening? Do I need to pause or perform
> > some
> > long running process from within the COM component to see the behavior I
> > am
> > talking about?
> >
> > The end goal is to make sure exposing portions of this COM dll will scale
> > if
> > called from within a WCF service. I have read articles like the following
> > that make me very cautious of doing this:
> >
> >
http://msdn.microsoft.com/msdnmag/issues/06/10/WickedCode/ > >
> > If this is indeed a problem, does anyone know a work around like the one
> > above for WCF to preserve at least some scalability.
>
> Scalability may not be your greatest problem. Has this COM component ever
> been tested in a multi-threaded environment (especially, on a multiple CPU
> system)? If it hasn't been tested in such an environment, then it may not
> work in that environment. I've seen heap corruption problems and such from
> COM components that claimed to be thread safe and were not.
> --
> --------------------------------------------------------------------------------
> John Saunders | MVP - Windows Server System - Connected System Developer
>
>