The Client/Server classes are a tool to help you distribute a lot of computation across multiple machines and across multiple cores on any given machine. It works with Linux or Windows. Template code is provided for usage. A concrete example is shown at the bottom. Download the MyClient.java file, the MyServer.java and the HashCodeChecker.java file to get started. Comments in each file describe what needs to be changed in order to make the code work.

***COMING SOON*** To give you a sense of how to make this tool work, I am providing a MyPrimeClient.java, a MyPrimeServer.java to test and look at. The server code is run on some server that is accessible from anywhere on the web. The client can be run on as many machines as you want to run it on. The server will start and will send numbers to the client to determine whether or not the number being sent is prime. The client will perform the prime calculation and will return a value of true or false back to the server. If the number is prime, the server will print it out to the terminal. Many modifications could be made to this program. For exmaple, the server could send multiple cases at once. The server could store these primes numbers into a file. There are, obviously, better ways to find prime numbers. However, the point of this example is to show how to use this software to distribute work across multiple machines and multiple threads on those machines.

One should note that if communication needs to occur between threads, this template will not be sufficient for what you need. For example, if the answer from machine X would affect the answer on machine Y, this code will not work. This code assumes that all cases are independent of each other. In order to share information, the server would have to store this information and send it to each client either periodically or with each case. Much more overhead would be required for dependent cases. I am working on a version of this code where knowledge sharing is possible. Because of the dynamic nature of the clients, all knowledge would come from the server. For example, implementing a version of the sieve of eratosthenes would require knowledge from other threads. Extra steps need to be added to the template to allow for this. That version is coming... probably not soon, but sometime.