next up previous
Next: int pvm_get_worker_class_id (char Up: int pvm_farm_init (char Previous: Client side

Server side

  1. Wait for any request from any task (tid = -1, msgtag = -1) (wildcard recv).
  2. On getting the message, extract the opcode from the buffer
  3. If opcode is INIT_FARM, then get tid and farm name from the client.
  4. Search the list of farm names for a farm of the name received from the client.
  5. If such a farm does not exist, append the farm name (and farmer tid) to the list of farm names. This creates a new farm item in the list of farms. Return OK the client if it is created successfully or ERROR if an error occurs.
  6. If the farm name already exists, then send a message to the client containing the return value FARM_NAME_PRESENT.
  7. Look at the list of pending requests and service these.
  8. Go back and wait for other messages


Sameer Shende