Rinda frustration

M

Mark Volkmann

I'm trying to determine what the methods "move" and "notify" do in the
Rinda class TupleSpace defined in lib/ruby/1.8/rinda/tuplespace.rb. I
don't see any mention of these in the articles I've found on Rinda. I
thought I could just look at the source and figure it out. Wrong! That
code is pretty complicated and is insufficiently commented in my
opinion.

If anyone knows what those methods do, even if it's just a guess, I'd
love to hear it!
 
R

Rick Nooner

I'm trying to determine what the methods "move" and "notify" do in the
Rinda class TupleSpace defined in lib/ruby/1.8/rinda/tuplespace.rb. I
don't see any mention of these in the articles I've found on Rinda. I
thought I could just look at the source and figure it out. Wrong! That
code is pretty complicated and is insufficiently commented in my
opinion.

If anyone knows what those methods do, even if it's just a guess, I'd
love to hear it!

I agree that Rinda isn't well documented. I have, however, been able to
make extensive use of it for a distributed testing application. It is
actually quite simple to use once you grasp the concepts.

Rinda is based on the Linda Distributed Programming system developed in
the 80's to ease the problems inherent in parallel programming on
super computers. Since Rinda is really just a reimplementation of
Linda, you can go to the much more comprehensive Linda documentation
to get an idea of how things are suppose to work.

A good place to start is http://suif.stanford.edu/papers/ppopp01.pdf

Here is an exceprt that explains move:

Two features are provided in FT-Linda to support atomic
execution: atomic guarded statements and atomic tuple transfer
primitives. Atomic guarded statements are used to execute
sequences of TS operations atomically, potentially after block-
ing; the atomic tuple transfer primitives move and copy allow
collections of tuples to be moved or copied between tuple
spaces atomically.

If you read the entire paper, it goes into much greater detail.

Go here for a post in comp.lang.ruby.general that goes into
more details about both move and notify.

http://permalink.gmane.org/gmane.comp.lang.ruby.general/114078

Rick
 
R

Rick Nooner

Anyone recommend a plainer-english version of some documentation that
goes into Linda/Rinda basics?

I don't know of any. Maybe it's time for someone to tackle this. I'll start putting something
together. I'll post when it's (hopefully) usable.

Rick
 
R

Rick Nooner

There is this:

http://www.chadfowler.com/ruby/drb.html

by Chad Fowler, and I started to write

http://www.eng.cse.dmu.ac.uk/~hgs/ruby/dRuby/

before Druby-2.0.4 came out, so some of it is out of date, and some
aspects I don't understand yet anyway. I've not had time * energy
to update it recently, but patches would be welcome :)

HTH
Hugh

These sites are good for an intro to dRB and I wish I would have known
about them when I first started dealing with dRB, but they don't talk
about Rinda at all.

Rinda is built on top of dRB so an understanding of dRB is necessary
before tackling Rinda, however it would be nice to have more
documentation on Rinda itself.

You do provide some good links to Linda sites.

Someone could ask why, with the remote object invocation capabilities
of dRB would someone even want Rinda. It's because Rinda provides
a distributed "blackboard" that can simplify communication among
many distributed processes. We need a site that explains this
in detail, with examples since most people have never been exposed
to such a thing.

Rick
 
H

Hugh Sasse

These sites are good for an intro to dRB and I wish I would have known

Thank you.
about them when I first started dealing with dRB, but they don't talk
about Rinda at all.

Rinda is built on top of dRB so an understanding of dRB is necessary
before tackling Rinda, however it would be nice to have more
documentation on Rinda itself.

You do provide some good links to Linda sites.

Which I preface with
The Linda programming paradigm is included here because of its
applicability ro Rinda, which is part of dRuby.

But yes, that's barely a big enough mention of Rinda to be
considered "vanishingly small".
Someone could ask why, with the remote object invocation capabilities
of dRB would someone even want Rinda. It's because Rinda provides
a distributed "blackboard" that can simplify communication among
many distributed processes. We need a site that explains this
in detail, with examples since most people have never been exposed
to such a thing.

Also the blackboard handles concurrency issues well (using Ruby's
Threads), so that one need not concern themselves with these matters.
The blackboard, storing objects as Tuples - Arrays of things,
allows wildcard matching of objects so you can find them. You can
search for tuples where nil is regarded as a placeholder for
anything (like .* in regexps or * in a glob). This allows you to
query the tuplespace to see if the tuples you want are there.
It does mean that you need to know the length of the tuple you are
looking for however.

I can't tell you much about Ring -- it seems to be a way of making
tuplespaces themselves visible to packages using it, but I don't
understand how it works yet.
 
J

Joe Van Dyk

These sites are good for an intro to dRB and I wish I would have known
about them when I first started dealing with dRB, but they don't talk
about Rinda at all.

Rinda is built on top of dRB so an understanding of dRB is necessary
before tackling Rinda, however it would be nice to have more
documentation on Rinda itself.

You do provide some good links to Linda sites.

Someone could ask why, with the remote object invocation capabilities
of dRB would someone even want Rinda. It's because Rinda provides
a distributed "blackboard" that can simplify communication among
many distributed processes. We need a site that explains this
in detail, with examples since most people have never been exposed
to such a thing.

+1
 
E

Eric Hodel

I don't know of any. Maybe it's time for someone to tackle this.
I'll start putting something
together. I'll post when it's (hopefully) usable.

I've submitted a patch to M. Seki, but it has not been applied yet.
I will bug him again.
 
E

Eric Hodel

I'm trying to determine what the methods "move" and "notify" do in the
Rinda class TupleSpace defined in lib/ruby/1.8/rinda/tuplespace.rb. I
don't see any mention of these in the articles I've found on Rinda. I
thought I could just look at the source and figure it out. Wrong! That
code is pretty complicated and is insufficiently commented in my
opinion.

If anyone knows what those methods do, even if it's just a guess, I'd
love to hear it!

The 'move' method is unimportant, you'll probably never call it
directly. Look at TupleSpace#take and TupleSpaceProxy for how it is
used.

notify works like this:

##
# A NotifyTemplateEntry is returned by TupleSpace#notify and is
notified of
# TupleSpace changes. You may receive either your subscribed
event or the
# 'close' event when iterating over notifications.
#
# See TupleSpace#notify_event for valid notification types.
#
# == Example
#
# ts = Rinda::TupleSpace.new
# observer = ts.notify 'write', [nil]
#
# Thread.start do
# observer.each { |t| p t }
# end
#
# 3.times { |i| ts.write }
#
# Outputs:
#
# ['write', [0]]
# ['write', [1]]
# ['write', [2]]

class NotifyTemplateEntry < TemplateEntry
...
end

...

class TupleSpace

...

##
# Registers for notifications of +event+. Returns a
NotifyTemplateEntry.
# See NotifyTemplateEntry for examples of how to listen for
notifications.
#
# +event+ can be:
# 'write':: A tuple was added
# 'take':: A tuple was taken or moved
# 'delete':: A tuple was lost after being overwritten or expiring
#
# The TupleSpace will also notify you of the 'close' event when the
# NotifyTemplateEntry has expired.

def notify(event, tuple, sec=nil)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,780
Messages
2,569,607
Members
45,240
Latest member
pashute

Latest Threads

Top