• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Coordinating Processes Over Network

 
Lou Pelagalli
Ranch Hand
Posts: 150
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I have a class that will run on two or more separate physical machines connected over a LAN. However, I don't want to do the final processing until all but one has completed its task.

The problem to solve is that the task takes too long on one machine, so I've split the input file to process and file transfered it to the separate machines.

I'm thinking that one machine will be the controller, to which all other machines will report when their task is done. When all have reported completion then the controller can perform the final processing and end.

Any suggestions on how I can get the different machines to collaborate like this?

Any different approaches?

Thank You in Advance for Your Help,

Lou
 
Stefan Wagner
Ranch Hand
Posts: 1923
Linux Postgres Database Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have a look at rmi.
Or send a message over a socket.
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I once worked on an app that was 7 programs on one desktop communicating by DDE. (Yeah, a long time ago.) The driver spawned the other 6 as new tasks. As each one initialized it sent a message to the driver that it was ready. The driver counted these messages and when it got 6 it enabled the main window. Primitive but it worked. If you have asynchronous communication - you give another machine a task and then chug along with your own stuff while it's working - it might be an option.

If you have synchronous communication - you give another machine a task and block until it replies - you can create a thread for each worker bee and then join on all those threads. When they all finish your main thread will continue. That doesn't read very well ... lemme know if it's interesting and I'll find an example.

As mentioned above you have a wealth of protocol choices ... sockets, RMI, XML/HTTP, etc. Probably ought to make that choice first as it will affect the others.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic