[Spread-users] group membership

Jonathan Stanton jonathan at cnds.jhu.edu
Thu May 31 20:01:04 EDT 2001


Actually, these two functions can have somewhat different effects. If you
just ask "am I a member of this group" you expect a yes or no answer and
that will not include sending or receiving lots of data. If you ask the
larger question "who is in this group" then you are not sure how much data
you will receive, it could be a very large list with thousands of names on
it. You then have to parse it yourself (although the receiving it in the
first place is the bigger problem).

Both of them may be useful if you do not want to keep track of who is in
the group yourself. 

Because Spread uses a totally asyncronous model it is not possible to have
a "bool SP_is_group_member(char *group)" function that returns the answer
as the Spread library does not know the answer. Actually it is possible,
but it would involve the library tracking all messages it receives and
storing a big hash or somethin with all the groups it knows of and who is
in all of them. This is exactly the same thing that any application can do
more efficiently (by only tracking the groups it really needs and sharing
one copy of the table amoung all the connections it has). It would also
complicate mix up two different services. 

It would be possible to write up a pretty simple utility library separate
from libsp that stored the current membership of groups and was updated by
teh application when it received membership messages and could answer such
queries.

If your goal is to avoid all membership messages then no library based
solution will work.

Probably the "right" solution is to send a query to the daemon and have
it send an answer back. The SP_query_group_membership() function would
have to send a query  to the daemon. Then the daemon would send a
reply message with the answer back to the application in the normal stream
of messages.
Then your application would receive a new message through SP_receive
stating that 

"You are in group X" or 

"Here is the membership list of group X"

What do you all think of these different approaches? 

Jonathan

On Thu, May 31, 2001 at 11:57:19AM -0600, Roel van der Goot wrote:
> 
> On Thu, 31 May 2001, George Schlossnagle wrote:
> 
> > Or (I imagine this is what you really meant) who are the members of a given
> > group.
> 
> Correct, more general is always better.
> 
> Roel.
> 
> 
> 
> _______________________________________________
> spread-users mailing list
> spread-users at lists.spread.org
> http://lists.spread.org/mailman/listinfo/spread-users

-- 
-------------------------------------------------------
Jonathan R. Stanton         jonathan at cs.jhu.edu
Dept. of Computer Science   
Johns Hopkins University    
-------------------------------------------------------





More information about the Spread-users mailing list