Tickets

As mentioned previously, non-blocking RMI uses the class sidl.rmi.Ticket to handle the return values of non-blocking methods. There are actually two interfaces implemented by the Protocol that are used. sidl.rmi.Ticket and sidl.rmi.TicketBook


interface Ticket { 
  void block();
  bool test();
  TicketBook createEmptyTicketBook();
  Response getResponse();  //For internal Babel use
}

interface TicketBook extends Ticket { 
  void insertWithID( in Ticket t, in int id );
  int insert( in Ticket t );
  int removeReady( out Ticket t );
  bool isEmpty();
}

sidl.rmi.TicketBook is, obviously, a collection of Tickets. A Ticket represents the out arguments of a single non-blocking call. The user may test() if the call has returned yet, or block() until it does. The user can also get an empty TicketBook.

The TicketBook is a little more complex. It extends Ticket as well as creating some of it's own functions. It is mostly just to allow a user to make a large amount of nonblocking calls and work while they return. This is a common design paradigm in highly parallel scientific computing. In the case of TicketBook, it is assumed the user will input a bunch of Tickets with IDs. Then he can either block() on all of them (waitall), test() to see if any have returned, or block on removeReady (waitany). removeReady will return the id that the Ticket was inserted with so that the user may identify it. Perhaps with a case statement.

One odd thing about TicketBook is that you can insert multiple tickets with the same name. TicketBook will not warn you or throw an exception if you double up on the same name. If two different Tickets are put in the TicketBook with the same name, there is guarantee about what order they will come out in, even if you remove by name.



babel-1.4.0
users_guide Last Modified 2008-10-16

http://www.llnl.gov/CASC/components
components@llnl.gov