|
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.
|