Re: Thread local data structures

2009-07-27 Thread Aaron Cohen
Well, I was thinking smaller to start with. Hotspot identifies places where classes don't escape a method for instance and can use that to elide locks and inline field references without calling a constructor for instance. So it would be great to do this at the fn level in clojure as well, you kn

Re: Thread local data structures

2009-07-27 Thread Stuart Sierra
That sounds really, really hard. Because even if the structure is used in only one thread, you have to check that there's never a reference to an older version. You could theoretically re-implement the Persistent List/Map/Set interfaces with mutable implementations, but I don't know where to go

Thread local data structures

2009-07-27 Thread Aaron Cohen
What kind of infrastructure would it take to do something like Escape Analysis in the clojure compiler? It seems to me that it should be possible for "something" (the clojure compiler?, a new JIT of some sort?) to notice that a data structure is being used in a thread-local manner, and use that kno