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