ArticleslgStudy

computer science

Tuple space

Tuple space is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Tuple space rather than just read about it. In short: A tuple space is an implementation of the associative memory paradigm for parallel/distributed computing. It provides a repository of tuples that can be accessed concurrently.

Key takeaways

  • Tuple space belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Tuple space to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Tuple space from memory before moving on to harder problems.

Reference excerpt

A tuple space is an implementation of the associative memory paradigm for parallel/distributed computing. It provides a repository of tuples that can be accessed concurrently. As an illustrative example, consider that there are a group of processors that produce pieces of data and a group of processors that use the data. Producers post their data as tuples in the space, and the consumers then retrieve data from the space that match a certain pattern. This is also known as the blackboard metaphor. Tuple space may be thought as a form of distributed shared memory. Tuple spaces were the theoretical underpinning of the Linda language developed by David Gelernter and Nicholas Carriero at Yale University in 1986. Implementations of tuple spaces have also been developed for Java (JavaSpaces), Lisp, Lua, Prolog, Python, Ruby, Smalltalk, Tcl, and the .NET Framework.

Object Spaces Object Spaces is a paradigm for development of distributed computing applications. It is characterized by the existence of logical entities, called Object Spaces. All the participants of the distributed application share an Object Space. A provider of a service encapsulates the service as an Object, and puts it in the Object Space. Clients of a service then access the Object Space, find out which object provides the needed service, and have the request serviced by the object. Object Spaces, as a computing paradigm, was put forward in the 1980s by David Gelernter at Yale University. Gelernter developed a language called Linda to support the concept of global object coordination. Object Space can be thought of as a virtual repository, shared amongst providers and accessors of network services, which are themselves abstracted as objects. Processes communicate among each other using these shared objects — by updating the state of the objects as and when needed. An object, when deposited into a space, needs to be registered with an Object Directory in the Object Space. Any processes can then identify the object from the Object Directory, using properties lookup, where the property specifying the criteria for the lookup of the object is its name or some other property which uniquely identifies it. A process may choose to wait for an object to be placed in the Object Space, if the needed object is not already present. Objects, when deposited in an Object Space are passive, i.e., their methods cannot be invoked while the objects are in the Object Space. Instead, the accessing process must retrieve it from the Object Space into its local memory, use the service provided by the object, update the state of the object and place it back into the Object Space. This paradigm inherently provides mutual exclusion. Because once an object is accessed, it has to be removed from the Object Space, and is placed back only after it has been released. This means that no other process can access an object while it is being used by one process, thereby ensuring mutual exclusion.

JavaSpaces JavaSpaces is a service specification providing a distributed object exchange and coordination mechanism (which may or may not be persistent) for Java objects. It is used to store the distributed system state and implement distributed algorithms. In a JavaSpace, all communication partners (peers) communicate and coordinate by sharing state. JavaSpaces can be used to achieve scalability through parallel processing, it can also be used to provide reliable storage of objects through distributed replication, although this won't survive a total power failure like a disk; it is regarded by many to be reliable as long as the power is reliable. Distribution can also be to remote locations; however, this is rare as JavaSpaces are usually used for low-latency, high-performance applications rather than reliable object caching. The most common software pattern used in JavaSpaces is the Master–Worker pattern. The Master hands out units of work to the "space", and these are read, processed and written back to the space by the workers. In a typical environment there are several "spaces", several masters and many workers; the workers are usually designed to be generic, i.e. they can take any unit of work from the space and process the task. JavaSpaces is part of the Java Jini technology, which on its own has not been a commercial success. The technology has found and kept new users over the years and some vendors are offering JavaSpaces-based products. JavaSpaces remains a niche technology mostly used in the financial services and telco industries where it continues to maintain a faithful following. The announcement of Jini/JavaSpaces created quite some hype although Sun co-founder and chief Jini architect Bill Joy put it straight that this distributed systems dream will take "a quantum leap in thinking."

Example usage The following example shows an application made using JavaSpaces. First, an object to be shared in the Object Space is made. Such an object is called an Entry in JavaSpace terminology. Here, the Entry is used to encapsulate a service which returns a Hello World! string, and keeps track of how many times it was used. The server which provides this service will create an Object Space, or JavaSpace. The Entry is then written into the JavaSpace. The client reads the entry from the JavaSpace and invokes its method to access the service, updating its usage count by doing so. The updated Entry is written back to the JavaSpace.

Books Eric Freeman, Susanne Hupfer, Ken Arnold: JavaSpaces Principles, Patterns, and Practice. Addison-Wesley Professional, 1. June 1999, ISBN 0-201-30955-6 Phil Bishop, Nigel Warren: JavaSpaces in Practice. Addison Wesley, 2002, ISBN 0-321-11231-8 Max K. Goff: Network Distributed Computing: Fitscapes and Fallacies, 2004, Prentice Hall, ISBN 0-13-100152-3 Sing Li, et al.: Professional Java Server Programming, 1999, Wrox Press, ISBN 1-86100-277-7 Steven Halter: JavaSpaces Example by Example, 2002, Prentice Hall PTR, ISBN 0-13-061916-7

Interviews Gelernter, David (2009). "Lord of the Cloud". John Brockman, Editor and Publisher Russell Weinberger, Associate Publisher, Edge Foundation, Inc. Heiss, Janice J. (2003). "Computer Visions: A Conversation with David Gelernter". Sun Developer Network (SDN). Venners, Bill (2003). "Designing as if Programmers are People (Interview with Ken Arnold)". java.net.

… excerpt ends here. Continue reading the full article.

Worked examples

Example 1 — a first encounter with Tuple space

Start with the simplest possible case. Write down what Tuple space claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Tuple space before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Tuple space ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Tuple space

In research
Tuple space appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Tuple space in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Tuple space is common in secondary-school and first-year university syllabi. It links to neighbouring topics Distributed computing architecture, Java (software platform), Parallel computing, so understanding it makes those chapters shorter.
In everyday life
Look for Tuple space outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Tuple space” →

How to study Tuple space in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Tuple space means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Tuple space out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Tuple space in simple terms?

A tuple space is an implementation of the associative memory paradigm for parallel/distributed computing. It provides a repository of tuples that can be accessed concurrently.

Why does Tuple space matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Tuple space?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Tuple space.

Tags

  • Distributed computing architecture
  • Java (software platform)
  • Parallel computing
  • Programming languages

Keep exploring