Re: Threading Support in ORBit2



Michael Meeks wrote:
> Hi Greg,
> 
> On Wed, 2003-05-07 at 06:10, Greg Edwards wrote:
> 
>>In a server once you run CORBA_ORB_run() the underlying library takes 
>>over and waits on inbound traffic, correct?
>>
>>A message is received and execution begins in the skelimpl for that 
>>method.  Until that method completes no other messages can be processed 
>>for that IOR (object)?  To get around this blocking you can create 
>>threads but each thread requires a unique IOR?
>>
>>On the client side when you send a message the client blocks waiting for 
>>return from the server?  Without threads you cannot run CORBA_ORB_run() 
>>since that process is taken over by the library?
>>
>>Maybe I don't understand the use of CORBA_ORB_run() clearly enough.  Can 
>>you receive and process messages without calling it?
> 
> 
> 	If you invoke a stub, you sit in an ORB loop processing incoming
> requests until you receive a reply.
> 
> 	HTH, & please CC all correspondance to the orbit-list,
> 
> 	Regards,
> 
> 		Michael
> 

So, a so called client is not really a true client in that it can act as 
a non blocking server while the original message is pending?  I can see 
where this could be useful, also dangerous.

Without invoking threads, and calling CORBA_ORB_run() from a thread, is 
there any way for a server to process received messages?  More of a 
polling approach from a single execution path.  Or is CORBA_ORB_run() 
the only way to start a communications monitor?  As far as I can tell 
once you call CORBA_ORB_run() that execution path (thread) cannot be 
taken back from the ORBit libraries without shutting down the program 
(thread).

For a couple servers in my system I'd like to run a state machine that 
is not multi-threaded so I'd want to run something like:

while(working)
{
   if CORBA_MSG_pending()
     CORBA_ORB_runone()
   do_work_things()
   check_working_status()
}

Yes I know I can do this with threads, but that would not be my first 
design choice.  If threads are my only choice then it'll be threads.

TIA,
-- 
Greg Edwards
New Age Software, Inc. - http://www.nas-inet.com
======================================================
Galactic Outlaw        - http://goutlaw.nas-inet.com
   The ultimate cyberspace adventure!




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