next up previous
Next: int pvm_send_reply_packet(void); Up: int bufid = Previous: Client side

Server side

  1. If the opcode matched RECV_WORK_PACKET, extract the unique worker class id of the client and the tid of the client (using the buffer id of the received message).
  2. Using this worker class id, search for the worker class item using the Cache of worker class ids (array index is wcid).
  3. If the worker class item is not present (pointer is NULL), then that means that the farm associated with the current worker class id has terminated and the data structure associated with the farm has been deleted. Send a message to the client which has a message tag of FARM_HAS_TERMINATED and look for other service requests.
  4. If the worker class item is present then using the client tid, search for a worker item. If not present then return ERROR.
  5. Pop a work packet from the list of work packets pending and associated with the current worker class.
  6. If there are no pending items (pointer is NULL), then set the number of packets pending field of the worker task as 0 and look for other service requests.
  7. If there is a packet pending then set the active send buffer id to that of the packet item which has been popped.
  8. Send the message to the client and free the buffer which was sent and the pointer of the popped item (housekeeping).
  9. Look for other service requests.


Sameer Shende