The process farms were implemented following the design of the farm daemon and the definition of the protocol for interprocess communication as described in Appendix A of the paper.
Figure 2: pvmfarmd - Internals
The farm daemon (pvmfarmd) was implemented using lists. The entire code was written in C++ making list as a class with member functions like append, delete, pop, search by name, search by value, etc. The farm daemon had a list of all farms (each farm was identified by a unique name and farmer task id). Each item in the farm list had a list of worker classes that were associated with it. Each item in the list of worker classes had a unique worker class identifier, the list of work packets awaiting distribution and a list of worker tasks enrolled in the worker class. Apart from these lists, there was a global list of all pending requests (e.g., the farmer requested for a worker class id and the worker class was not created, so it had to wait for a worker class to be created, etc.). When a work packet arrived at the farm daemon, it had to be forwarded to a single worker task. To search for the worker class to which the packet had to be addressed, one approach was to search each item in the farmer list for a matching farm name, then to get to the worker class list and then to search for the matching worker class id item and then to get a worker task that had no pending work packets. This was inefficient when a large number of work packets were sent to the farm daemon. Thus, to improve performance, a cache of worker class ids was maintained. The entries in this cache array pointed to the worker class item in the list of worker classes. So, in addition to the lists, the array of worker class items (indexed by the unique worker class id) was maintained. This structure is illustrated in figure 2.