I don't think I gain anything here, however, over just updating the graph in a dosync block, except I add a bunch of asynchronicity that I then have to block to avoid. With agents it also becomes more difficult to do static analysis on the graph.
On Tue, Mar 3, 2009 at 11:12 AM, Anand Patil < anand.prabhakar.pa...@gmail.com> wrote: > > On Mar 3, 3:38 pm, Jeffrey Straszheim <straszheimjeff...@gmail.com> > wrote: > > I'm pretty sure I don't want an agent based model. I want clear > > transactional semantics. However, there is no reason both should not > > exist. > > I think you can get solid transactions with lazy agents, since an > update corresponds to a single step/data pulse/whatever. Pseudocode: > > (dosync > Attach a watcher to all the cells, that when requested blocks > until they've computed a new value > Change the values of the base cells > Send an update message to all the cells, which will cause them all > to update exactly once > Wait on the watcher) > > Since agents are integrated with the STM, my understanding is that the > new data update will get written in all at once. Is that good enough > for your purpose? > > As Raffael pointed out, the laziness doesn't get you recording of > previous values... but that wouldn't be inordinately challenging to > add in. > > Anand > > > --~--~---------~--~----~------------~-------~--~----~ 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 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 -~----------~----~----~----~------~----~------~--~---