Re: Is it possible to have Component services create a new host each time an object is created

Tech-Archive recommends: Fix windows errors by optimizing your registry



Well the problem I'm trying to solve is this. My COM object, the dll COM
object is actually based on a system that we are provided with. The runtime
system for this, while it supports multithreading within its own environment
that we use, is actually not a true multithreaded windows application. So
if you create multiple instances of an object and they are both running at
the same time and hosted by the same process, one will get blocked until
the other one finishes running. This also means that the process gets bound
to a particular CPU on a multi-cpu system thus negating the benefit of
multiple CPU's. So to get around this, I created a cover ActiveX COM EXE
that simply creates an instance of my COM dll and returns it. That means
that each instance of my COM dll is hosted in its own ActiveX COM EXE and
gets its own runtime environment and doesn't have to wait for anybody and is
free to run on any CPU available.

So, I'm trying to duplicate this behavior with Component Services.
Basically I would like to have Component Services create a new dllhost.exe
each time I create an instance of my COM dll object.

I actually think I have discovered how to do this. In the properties for my
server object in Component Services, on the Pooling & Recycling tab, if I
set the Pool Size to its maximum of 999,999 - got the value from the MS
website and others, each time and object creation request comes in,
Component Services will create a new dllhost.exe to host that object until
this number is reached. Since I don't ever anticipate have 999,999 objects
going at any one time I think this might just be what I'm looking for.

Is this what you found out also ?

Nick

"Olivier Matrot" <olivier.matrot@xxxxxxxxxxxxx> wrote in message
news:eN4HBbKTFHA.2560@xxxxxxxxxxxxxxxxxxxxxxx
> Is your goal is to serialize access to your COM object because it is
> Apartment threaded, hosting a service component that calls your COM object
> in COM+ is one solution. I've had the same problem.
>
> "Nick Palmer" <nick@xxxxxxxxxxx> wrote in message
> news:1172q1q3qt1c365@xxxxxxxxxxxxxxxxxxxxx
> > Hi all,
> >
> > I have a COM object (a dll) and unfortunately for me, this object is
> > single
> > threaded and I have no way to change this behavior. What I currently do
> > is
> > host this COM object (the dll) in a ActiveX EXE COM object. So
everytime
> > I
> > need a new instance of the dll COM object, I create a instance of the
> > ActiveX EXE COM object and this creates an instance of the COM dll
object
> > and returns it. So this way I have a single host for each dll COM
object
> > and I don't have to deal with single threading in the COM dll.
> >
> > Now, I would like to get away from this way of doing things, and I was
> > wondering if Component services would provide similar functionality.
I've
> > done some testing with Component services and so far like what I have
> > seen.
> > I created a Server componnent, and then added my COM dll. Now, when I
> > create an instance of my COM dll I can see a dllhost.exe app gets
created
> > that is the host for my COM dll. But now, if I launch a second copy of
my
> > testing program , and I create another instance of my COM dll, I do not
> > get
> > an additional dllhost.exe program. So I'm assuming that both instances
of
> > my COM dll are being hosted by the same dllhost.exe. This is the
behavior
> > that I was trying to avoid. So, is it possible to have Component
Services
> > create a new host app (dllhost.exe) each time I create a new instance of
> > my
> > COM dll ?
> >
> > Thanks in advance,
> > Nick
> >
> >
>
>


.



Relevant Pages

  • Re: IIS Stops Responding -- IISState Info Included
    ... After I added the dll to Component Services, ... Unattended Execution and Retain in Memory options. ... which also warned against using global variables in a BAS module. ...
    (microsoft.public.inetserver.iis)
  • Re: IIS Stops Responding -- IISState Info Included
    ... > After I added the dll to Component Services, ... > Unattended Execution and Retain in Memory options. ... which also warned against using global variables in a BAS module. ...
    (microsoft.public.inetserver.iis)
  • Re: Using MTA COM+ Objects in ASP Pages
    ... Even if i register using regsvr32 or Component Services Menu, ... DLL seem to work for sometime. ... Our MTA Component is an ActiveX Server Componet with Free Threaded ...
    (microsoft.public.vc.atl)
  • Re: Is it possible to have Component services create a new host each time an object is created
    ... setting the pool size to a huge value is possible, but not a very nice solution. ... And even if COM+ did support a REGCLS_SINGLEUSE option, the solution would be the same as you already created yourself - a new dllhost surrorage is loaded for each activation which in turn loads and activates your DLL. ... I'm trying to duplicate this behavior with Component Services. ... ActiveX EXE COM object and this creates an instance of the COM dll ...
    (microsoft.public.dotnet.framework.component_services)
  • Is it possible to have Component services create a new host each time an object is created
    ... I have a COM object (a dll) and unfortunately for me, ... host this COM object in a ActiveX EXE COM object. ... done some testing with Component services and so far like what I have seen. ... testing program, and I create another instance of my COM dll, I do not get ...
    (microsoft.public.dotnet.framework.component_services)