top | item 2281968

Tuple Spaces (or, Good Ideas Don’t Always Win)

74 points| krs | 15 years ago |software-carpentry.org

22 comments

order
[+] DrJosiah|15 years ago|reply
I built a tuple space implementation a few years ago. I came to the conclusion that the filter predicates were functionally equivalent to delayed RPC, aka task queues, and occasionally even publish/subscribe. It's at that point that I got bored and left the code to (essentially) rot.

I now use task queues on a daily basis to process countless non-realtime tasks. It's a much more straightforward metaphor for what you actually want to do, and without altering the paradigm, allows you to do practically useful things (prioritizing, deadlines, retries, etc.)

It is a useful conceptual model, but mostly as a way to pull people away from the MPI/PVM/threads/processes lock-step/locking parallel concurrency models.

[+] jerf|15 years ago|reply
Has anyone successfully used this for anything significant? As I post this there's only a couple of people posting about how either they tried but it didn't work out well enough, or they just played with it in school without any code.

It strikes me as having the same problems as RDF storage; precisely because the model is so general, there's nothing for optimizations to grab on to and optimize on. Your database has to stand ready to do anything equally. The core of database optimization is, when you really get down to it, working out how to tell your database which things you really want and what you will never care about, as in "This table has twenty columns but I will only query on name and phone number". In practice, limitations aren't always just there because of a lack of imagination or insufficient computer science education (though that does happen), sometimes they're there because you can't get any performance without them.

[+] mmastrac|15 years ago|reply
I did a post-grad project using JavaSpaces and prolog to do automated refactoring in Java back in the late 90's. The JavaSpaces implementation was so terrible that it was hard to get anything done. Great idea, but poor execution in Java probably killed Jini and JavaSpaces (and any hope of it going mainstream).
[+] sleight42|15 years ago|reply
Sure. I used a TupleSpace for an impromptu map-reduce for some heavy duty number-crunching across multiple cores and physical machines.
[+] regularfry|15 years ago|reply
Yeah, I've used Rinda for load balancing across small numbers of machines before. It's a couple of screens of ruby in total to get that working, which I was astonished by.
[+] cachemoney|15 years ago|reply
I tried it in Ruby in ~2006, and found that many operations in Rinda were O(n) in the size of the tuple space :(
[+] murrayh|15 years ago|reply
Interesting. Could a better-than-O(n) parallelisable tuple space be implemented with something like skip lists?
[+] pohl|15 years ago|reply
We use GigaSpaces (a commercial implementation of JavaSpaces that can also be used from a .NET environment) where I work, but we're underutilizing its capabilities terribly. The product itself apparently has a healthy niche in the financial services sector.
[+] raymondh|15 years ago|reply
Tuple spaces seem to have morphed into routers and filters for message queue protocols.
[+] sophacles|15 years ago|reply
I laughed when I read you comment because I find my message queues always seem to want to morph into these Tuple Spaces -- seriously. I never knew there was a name here, just that I seem to frequently want some more generic properties matching nicely to the this whole pattern.
[+] spaznode|15 years ago|reply
Biggest issue I had was the idea of communicating data through the actual space which is why message based protocols that handle direct function/method invocation on take are so much easier to deal with and not worry about performance issues.

It sure as shot was fun to play with it in a big enterprise environment for a while though. =)

[+] fleitz|15 years ago|reply
I've used this pattern with F# and Mailboxes, works great. Never knew it was called a Tuple Space.
[+] gnubardt|15 years ago|reply
Saw a cool presentation by Gary Warren King on AllegroGraph (a lisp based tripple store) last year. It stores RDF tripples, which seem to be a pretty powerful tool for modeling semantic relationships.

The slides and a recording are available on the lispnyc site: http://lispnyc.org/meetings

[+] wulczer|15 years ago|reply
I did Linda in the university, during the Concurrent Programming course. It was lots of fun, even though we never actually wrote a line of code in any place other than the blackboard... It is sad that the model did not take off.
[+] shotgun|15 years ago|reply
How does tuple space, as discussed here, compare to something like Redis?
[+] tjarratt|15 years ago|reply
I'd say they compare closely to either Redis' hash or unsorted list implementations. It's hard to say exactly since the operations tuples support are similar to both.

This, of course, ignores the complexity of operations on Redis hash and list objects. I don't think any tuple space implementation has a known complexity for get or put operations.

[+] irv|15 years ago|reply
cool. but this seems fundamentally similar to the Chan/Var style of parallelism in haskell?