What Does Tuple Space Mean?
A tuple space is an execution of the associative memory model for distributed/parallel computing. It offers a library of tuples, which can be accessed simultaneously. Tuples are terms with zero or more arguments and a key.
The collection of tuples supports some basic operations, such as adding a tuple to the space (write) and removing a tuple from the space (take). The tuple collection is kept and managed over a network of multiple tuple space servers. Multiple threads on single or distinct machines simultaneously access the space. Some add tuples to the space whereas others remove them in a process that may be refereed to as a blackboard metaphor.
Techopedia Explains Tuple Space
Tuple spaces are the theory on which Linda language is based. Tuple space implementations are also developed for Java (JavaSpaces), Lua, Lisp, Python, Prolog, Ruby, .NET, Smalltalk and Tcl.
Tuple space abstraction is an effective choice for encapsulation in a module. It constitutes a useful structure with a well-defined interface. Therefore, it can be reused and modularized.
A few of the basic operations supported by the tuple space are as follows:
- write(tuple): Used to add a tuple to the space
- take(template tuple): Used to execute an associative search for a tuple that matches the template. Once found, the tuple is deleted from the space and then brought back.
- waitToTake(template tuple): Used to perform an associative search for a tuple that matches the template. It blocks until a match is located. It then removes and brings back the matched tuple from the space.
- read(template tuple): Same as "take" explained above, with the exception that the tuple will not be removed from the tuple space
- waitToRead(template tuple): Same as "waitToTake" explained above, with the exception that the tuple will not be removed from the tuple space
- scan(template tuple): Same as "read" explained above, with the exception that it returns a complete collection of tuples that match
- count(template tuple): Same as "scan," explained above, with the exception that it gives back a count of matching tuples instead of the collection of tuples itself.
Some examples of tuple space implementations include Apache River, the Blitz Project, the Fly Object Space, GigaSpaces and Linda in a Mobile Environment (LIME), among others.