From: Logan Capaldo Date: 2005-09-27T10:37:32+09:00 Subject: Re: tuple-space patterns and lock-free data structures (was: Ruby Threads 101) On Sep 26, 2005, at 8:33 PM, Zed A. Shaw wrote: > Ben, > > I had a lot of fun implementing the following patterns as a way of > avoiding almost all Thread primitives in a distributed video > processing system and boosting performance quite a bit: > > http://alumnus.caltech.edu/~croft/research/agent/tuplespaces/ > > In fact, Ruby comes with a nice tuple space implementation, so you > could take the above patterns, implement single instance versions, and > then try to distribute them. > > Those patterns are also good examples of why the logical proof of > single machine thread primitives does not instantly extend to > distributed processing. They are much simpler to use and do > exactly the same thing as distributed locking with nothing more than > simple tuple-space semantics rather than the complicated mutex and > semaphore semantics. > > I would also take a look at the work done on lock-free data structures > and algorithms. Lots of really great stuff that basically shows you > don't need locking on many data structures. Even more proof > that 1970's locking technology needs to be rethunk. > > My favorite fun project is doing a Replicated-Worker pattern with just > message queues. Sure the Queue needs locking, but why do you need to > know that? > > Enjoy! > > Zed A. Shaw > http://www.zedshaw.com/ > > Speaking of lock-free data sructures (sort of) has anyone ever implemented Erlang or E -style promises in Ruby?