[omniORB] Omniorb Demultiplexing Strategy.

Dayton Spencer dspencer@fiscal.org.jm
Fri, 23 Jun 2000 09:34:51 -0400


Can some one tell me what kind of demultiplexing strategy Omniorb 2.8 uses.



The code extract below is taken from the source in Omniorb 2.8. I cannot
determine precisely if the actual search for an object is done by
omniORB::hash(k) or a sequential search via the while loop. I am likely to go
with the sequential search though.

omniObject**        omniObject::localObjectTable = 0;
......
omniObject *
omni::locateObject(omniObjectManager*,omniObjectKey &k)
{
  omniObject::objectTableLock.lock();
  omniObject **p = &omniObject::localObjectTable[omniORB::hash(k)];
  while (*p) {
    if ((*p)->pd_objkey.native == k) {
      (*p)->setRefCount((*p)->getRefCount()+1);
      omniObject::objectTableLock.unlock();
      return *p;
    }
    p = &((*p)->pd_next);
  }
  omniObject::objectTableLock.unlock();
  return 0;
}