[prev in list] [next in list] [prev in thread] [next in thread] 

List:       jacorb-developer
Subject:    Re: [jacorb-developer] Multithreaded client
From:       Gerald Brose <brose () inf ! fu-berlin ! de>
Date:       2000-01-25 8:07:46
Message-ID: 388D59D2.F7B0AF5B () inf ! fu-berlin ! de
[Download RAW message or body]

Erlend Boe wrote:
> 
> Hi all,
> 
> I have been looking at the mtclient example, and I have some questions
> 
> The client seems to "magically" work even if orb.run() or
> orb.perform_work()   is not called
> Why is this?
> 
> If I have several objects in the client or the server, should I call
> orb.run in each thread, or just once ?
> 
> Does anybody have any other examples of multithreaded clients or
> servers?

orb.run() does not do anything - it just blocks the calling thread
until someone else call orb.shutdown(). It is not necessary to
call this at all if you don't want to block your main thread.

In the example, the main() method in Client.java only starts
ClientThreads. Client itself exits after creating these Threads,
and the threads themselves are busy firing off invocations, so
they don't need to block either. Calling orb.run() is only 
necessary if the Threads' run() method would otherwise exit.

Regards, Gerald Brose.
--
Gerald Brose,                       Mail:       brose@inf.fu-berlin.de
FU Berlin        (for PGP key see:) http://www.inf.fu-berlin.de/~brose
Institut f. Informatik              Ph-one:        (++49-30) 838-75112
Berlin, Germany                     Ph-ax:         (++49-30) 838-75109


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic