Re: having one bonobo control instance per process



On 14May2002 10:03AM (+0100), Michael Meeks wrote:
> 
> > One conclusion I have made so far, after taking a look at the vim
> > source, is that due to all the global data structures, it would be nigh
> > impossible to have more than one component per process.  Thus each
> > instance of gnome-vim must run in its own process.  
> 
> 	Ok, fine.
> 
> > Conceptually this seems straightforward, but I have not been able to
> > find an example of a different project which does this.  All bonobo
> > controls which I've seen have a factory component to produce the
> > instances, and the factory runs in the same process as all of the
> > instances.  
> 
> 	Oh; yes, this could be marginally tricky I suppose.

There's no a priori reason you have to use a factory server. You can
just make the control be an exe server directly. Instead of
registering the factory when your executable runs, you can register
the control object itself. 

Unfortunately, this does not really entirely solve your problem. If
the component is registered,

However, you could cut & paste the part of the registration code that
prints out the IOR, and do only that part, not the whole
registration. Then I think you will get a new process for each
control.

There is also an activation flag you can pass that says to activate a
new component regardless of whether one is registered, so you could
use that in the activate call. I guess if you do that, it doesn't
matter if you use a factory or not; but the onus is on the user of the
component to use it right.

Yet a third approach is to have a "proxy" factory component which is
what client code uses, but which actually activates the components in
separate processes using the real factory server, and the private flag
which makes a new instance every time. I think this is your best bet,
even though it means an extra process.

Michael is right that something you could specify in the .server file
would be much nicer than all of this.

 - Maciej



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]