Main Page | Namespace List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages | Examples

Tutorial

This is a brief tutorial on how to write a program to use the PyLinda system.

Connecting

The first thing any linda client will want to do is to connect to the linda network. This is done by importing the linda package and then calling the connect function.

import linda
linda.connect()

Creating a TupleSpace

All linda clients have access to one tuplespace, the universal tuplespace, however it is generally used merely as a way for various process to contact each other. The majority of communication should be done through other tuplespaces. You can create new tuplespace by creating an instance of the TupleSpace class.

ts = linda.TupleSpace()

Your master process will usually want to output the tuplespace reference to the universal tuplespace where the slave processes can read it.

The master process...

linda.universe._out(("My identifying string", ts))

The slave process...

ts = linda.universe._rd(("My identifying string", linda.TupleSpace))[1]

Operations on a TupleSpace

Now you have access to a private tuplespace you'll want to perform some operations on it. All the available operations can be found here
PyLinda is © Copyright 2004 Andrew Wilkinson.

Generated on Mon Feb 6 10:12:06 2006 for PyLinda by doxygen 1.4.0