The following might be of interest to Clojurians: https://github.com/tvcutsem/stm-in-clojure is a meta-circular implementation of STM in Clojure. It was created purely for educational purposes (to allow people to better understand STM by reading a Clojure implementation, without having to descend into the Java implementation). The simplest meta-circular MVCC implementation weighs in at less than 200 LOC.
I use this implementation for teaching. There's a set of slides that accompany this code at http://www.slideshare.net/tvcutsem/stm-inclojure I welcome any feedback on this implementation. I'm fairly new to Clojure myself, so comments on style are also appreciated. For those "into" Clojure's real STM implementation, pointing out any aspects of my meta-circular implementation that may be misleading as compared to the built-in STM would be particularly helpful. Kind regards, Tom 2010/11/2 Tom Van Cutsem <tomvc...@gmail.com> > Hi, > > In a couple of months I will teach a new course on concurrent/parallel > programming at the University of Brussels. I will use Clojure for a large > part of the course. I primarily want the students to learn how to make > effective use of the STM as Clojure programmers, but I would also like to > expose them to some "under the hood" implementation details. One option > would be to dive into the actual Java implementation of Clojure's STM, but > my fear is that this will be too complex. Another option I've been thinking > of is to write a simple, didactic STM in Clojure itself (following the SICP > meta-circular interpreters tradition). It goes without saying that high > performance is not the goal here. Rather, it should help students to grasp > atomicity, isolation, interactions between readers/writers, the differences > between alter and commute, etc. > > My questions to the list: > - has anyone already experimented with a toy STM in Clojure for didactic > purposes? > - what would be a good resource to start such a design from? (my current > plan is to start from <http://java.ociweb.com/mark/stm/article.html>) > > Thanks, > Tom > -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en