View Single Post
  #1 (permalink)  
Old 08-20-2003
rhochmuth rhochmuth is offline
Registered User
 
Name: Roland Hochmuth
Organization: HP
Project: RGS
 
Join Date: Aug 2003
Posts: 86
Sequential order processing?

Since Ice does not guarantee that method invocations are processed in order I was wondering if there were any recommendations or best practices.

What I have is a scenario, very simliar to the one Ice Mutex discussion, in which a number of methods are invoked, and then I need a way to wait on all of them to complete prior to processing the next command.


Client code looks as follows:

for (int i = 0; i < numSubWidgets; i++)
{
// Create new SubWidget.
subWidget[i] = new SubWidget();

// Send the widget to the server for processing.
serverProxy->consume(subWidget(i));
}

// Inform that server that all sub-widgets have been sent.
serverProxy->end();


What I need to happen is that the server->end() method is invoked after all of server->comsume() commands have completed. Basically the server side processing of the end() method needs to wait on all previously dispatched consume() methods.

I guess I could limit the server thread pool to 1, but I'm hoping for a more general solution.
Reply With Quote