next up previous
Next: int pvm_send_work_packet(int id); Up: Appendix- Algorithms for Previous: Server side

Algorithm for ProcessPending() at the Server side.

  1. Check the number of pending items in the global list of the pending requests related to farm setup.
  2. Pop one by one all the requests from the list.
  3. If the opcode in the pending request is GET_WORKER_CLASS_ID, then get the farm name, the worker class name, and the task id of the farmer.
  4. Execute ProcessGetWorkerClassId() with these parameters. This function is the same as above (when a pvm_get_worker_class_id() call is executed).
  5. If the opcode is INIT_WORKER_CLASS, then get the farm name, the worker class name and the task id of the worker task.
  6. Execute ProcessInitWorkerClass() with these parameters. This function is illustrated above.
  7. Note that all the algorithms of farm set up functions are executed as functions with parameters. This helps so that either the main server task can call these when the client requests for the service, or the ProcessPending() can call these.


Sameer Shende