Next: int pvm_get_worker_class_id (char
Up: int pvm_farm_init (char
Previous: Client side
- Wait for any request from any task (tid = -1, msgtag = -1) (wildcard recv).
- On getting the message, extract the opcode from the buffer
- If opcode is INIT_FARM, then get tid and farm name from the client.
- Search the list of farm names for a farm of the name received from the client.
- 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.
- If the farm name already exists, then send a message to the client containing the return value FARM_NAME_PRESENT.
- Look at the list of pending requests and service these.
- Go back and wait for other messages
Sameer Shende