home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / parallel / 1897 < prev    next >
Encoding:
Text File  |  1992-08-11  |  2.5 KB  |  55 lines

  1. Newsgroups: comp.parallel
  2. Path: sparky!uunet!gatech!hubcap!fpst
  3. From: martin@xenon.stanford.edu (Martin C. Rinard)
  4. Subject: Re: PVM: thoughts on data-passing routines
  5. Message-ID: <1992Aug12.121940.6378@hubcap.clemson.edu>
  6. Apparently-To: comp-parallel@uunet.uu.net
  7. Sender: news@times.stanford.edu
  8. Organization: Computer Science Department, Stanford University.
  9. References: <1992Aug11.121234.28784@hubcap.clemson.edu>
  10. Date: Tue, 11 Aug 1992 19:13:26 GMT
  11. Approved: parallel@hubcap.clemson.edu
  12. Lines: 41
  13.  
  14. jek@cs.duke.edu (James E. Kittock) writes:
  15.  
  16. > While working on this, I have come to the conclusion that the C
  17. > interface to PVM has a serious "want", namely, a routine to
  18. > automagically put a structure and all of its contents, *including* the
  19. > contents of any arrays/structures/unions pointed to by members of that
  20. > structure.
  21.  
  22.   This is a standard problem in distributed systems. To recursively
  23. pass a data structure between machines, you in general have
  24. to pack recursively all the objects to which the first object points into a
  25. message, then unpack the objects on the other side and reconstruct
  26. the pointers. To pack an object given a pointer to that object, 
  27. you need to know the type and size of the object. In general, 
  28. it is impossible for a C program to get type and size information 
  29. given only a pointer to an object. If you want to recursively pass
  30. data structures between machines, you need to augment either the 
  31. pointers or the data structures to which they point with type and 
  32. size information. 
  33.  
  34.   Here at Stanford, we have developed a language called Jade that
  35. supports the concept of an object which consists of several 
  36. allocation units. The Jade frontend generates routines that 
  37. recursively pack and unpack such objects, reconstructing the
  38. pointers as necessary.  When the Jade implementation determines that
  39. such an object needs to be passed from one machine to another, 
  40. the sender calls the packing routines to put the data into a message,
  41. then sends the message off to the receiver. The receiver then 
  42. invokes the routines that unpack the object and reconstruct the
  43. pointers. To support this functionality, the Jade memory allocators
  44. augment allocated data with a type tag and a size tag. The packing
  45. routines use these tags to determine how to pack and unpack the objects.
  46.  
  47.   So, such a scheme (in general) requires programming language support
  48. beyond that which C provides. But, you can put the type and size tags
  49. in by hand, and generate your own routines to pack and unpack the
  50. data structures. 
  51.  
  52.  
  53.   Martin
  54.  
  55.