home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / sys / isis / 204 < prev    next >
Encoding:
Internet Message Format  |  1992-07-22  |  2.1 KB

  1. Path: sparky!uunet!dtix!darwin.sura.net!mips!zaphod.mps.ohio-state.edu!rpi!batcomputer!cornell!ken
  2. From: ken@cs.cornell.edu (Ken Birman)
  3. Newsgroups: comp.sys.isis
  4. Subject: Re: Array Indexing with addresses
  5. Message-ID: <1992Jul23.140941.9177@cs.cornell.edu>
  6. Date: 23 Jul 92 14:09:41 GMT
  7. References: <91672@bu.edu>
  8. Distribution: usa
  9. Organization: Cornell Univ. CS Dept, Ithaca NY 14853
  10. Lines: 34
  11.  
  12. In article <91672@bu.edu> hss@bigbird.bu.edu (Himanshu Sinha) writes:
  13. >I need to maintain a queue of messages sent by each member of a process group.
  14. >When a process receives a message it enqueus it in the queue for the sender of
  15. >the message. I want a fast way of finding out which queue to enque it in...
  16.  
  17. Unless the number of processes becomes huge, a linear search will be the
  18. cheapest solution.  pg_rank, which you asked about, does a linear search
  19. over the members of the groupview, applying addr_isequal on each, so
  20. it won't be faster. 
  21.  
  22. If the number does become large (say, 50 or 100 possible senders), 
  23. my advice would be to design a hashed data structure.  Actually, there
  24. is such a thing in the toolkit itself, but not documented.  The
  25. has index should be computed from:
  26.     addr->addr_process -- (low 16 bits of) pid of the sender
  27.     addr->addr_site, addr->addr_incarn -- place it lives
  28.     addr->addr_portno -- UDP port number it is using.
  29.  
  30. Actually, since hashing is just approximate, you can probably just use
  31. the addr_process information for the hash index and then use addr_cmp
  32. to scan the queue this indexes to.
  33.  
  34. By the way, SVR4 has 32 bit process-id's and we will go to 32
  35. bits in ISIS V3.0.7 this fall.  Meanwhile, ISIS V3.0.6 can run on
  36. Solaris but will only track the low 16 bits of the pid.  This 
  37. doesn't affect correctness of ISIS itself, since the portno 
  38. is certain to be unique on a given machine, but it could lead to
  39. confusion if Solaris actually generates long pid's on a casual basis.
  40.  
  41.  
  42. -- 
  43. Kenneth P. Birman                              E-mail:  ken@cs.cornell.edu
  44. 4105 Upson Hall, Dept. of Computer Science     TEL:     607 255-9199 (office)
  45. Cornell University Ithaca, NY 14853 (USA)      FAX:     607 255-4428
  46.