[omniORB] Single threaded CORBA object in OmniORBpy

Lazy lazy at leba.lazy.one.pl
Mon Jul 19 19:31:48 BST 2004


Hello:

I'm running Omniorb 4.0.1 and omniORBpy 2.3 under windows XP sp1

Please look at the code below irrevelant code is removed

test.py
---
orb = CORBA.ORB_init()
poa = orb.resolve_initial_references("RootPOA")
poa_mgr= poa._get_the_POAManager()

class proxyIMP(COM__POA.proxy):
    def __init__(self):
        self.com=None
        pass
   
    def Dispatch(self,name):
        pythoncom.CoInitialize()
        self.com=win32com.client.Dispatch(name)

    def call(self,name,args):
        return to_any(self.com.__get_attr__('name')( *from_any(args) ))
       
    def set(self,name,val):
        self.com.__setattr__(name,from_any(val))

    def get(self,name):
        return to_any(self.com.__getattr__(name))
       
pr=proxyIMP()
prx=pr._this()

print orb.object_to_string( prx)

poa_mgr.activate()

orb.run()
-------------------------------------

It is a part of  simplistic COM -> CORBA  bridge (it's my project for 
scholl :))
The big problem for me is threading model of COM (COM reference neads to 
be directed to one thread)
in CORBA there are multiple threads running the servant.

I'm late with my assigment and I nead it fixed fast.
I found some information about switching to one thread for objects mode 
in 
http://www.omniorb-support.com/pipermail/omniorb-list/2003-November/024496.html 
using the omniORB::setMainThread(). But I failed to locate this method 
in omniORBpy's omniORB.CORBA.ORB class.

One thread per object would be good too i nead to make shure that 
proxyIMP instances are run in one thread per instance only or all in one 
thread.

Thanks in advance
--
Michal Grzedzicki < mailto:lazy(at)leba.lazy.one.pl >




More information about the omniORB-list mailing list