[Spread-users] group membership

Julien Dufour julien at posse42.net
Thu May 31 22:29:20 EDT 2001


On vendredi, juin 1, 2001, at 02:01 , Jonathan Stanton wrote:

> 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?

I agree with you. I think both methods are interesting.

The second one is mandatory in order to answer questions like 
"Is X in group Y?" or "Who is in group X?" because the spread 
library does not (and should not) own this information (the 
client would have to be in every group...).

However, this way raises performance and load issues:
- The server has to be contacted for each request, which is "slow."
- It would cost bandwidth, potentially a lot of it depending on 
the request.

The "utility" method is less exhaustive, but much more 
efficient. I like this way because I think it can handle most 
common cases (getting information about joined groups), the 
implementation is trivial and moreover it is modular.

Both methods appear to be complementary. Writing some library 
that would use both of them at the same time (the utility and 
the queries) would be very useful. The library would keep track 
of the membership of specified joined groups, dig into the data 
in the first place, and would query the server when the data 
don't hold the requested information.

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





More information about the Spread-users mailing list