CORBA Programming Reference
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Allows the ORB to perform server-related work.
void CORBA::ORB::perform_work ();
None.
Once the ORB has shut down, a call to work_pending
and perform_work()
raises the BAD_INV_ORDER
exception. An application can detect this exception to determine when to terminate a polling loop.
If called by the main thread, this operation allows the ORB to perform server-related work. Otherwise, it does nothing.
The work_pending()
and perform_work()
operations can be used to write a simple polling loop that multiplexes the main thread among the ORB and other activities. Such a loop would most likely be needed in a single-threaded server. A multithreaded server would need a polling loop only if there were both ORB and other code that required use of the main thread. See the example below for such a polling loop.
The following is an example of a polling loop:
// C++
for (;;) {
if (orb->work_pending()) {
orb->perform_work();
}
// do other things
// sleep?
}
![]() ![]() |
![]() |
![]() |