Hi,

I have two questions about the reasons behind the design of Clojure's 
software transactional memory (STM):

(1) Why is snapshot isolation the default rather than linearizability? For 
those who don't know, the difference between the two guarantees is that 
snapshot isolation requires all reads to occur at a read point and all 
writes to occur at a later write point, whereas linearizability 
additionally requires those two points to be one and the same. Most of 
closure's design seems to prefer correctness over efficiency, but this 
decision places efficiency over correctness. Why not make the safe behavior 
of the current "ensure" the default with the one-character name and leave 
the more efficient but harder to understand "deref" behavior as something 
available when optimizing hot code?

(2) Was the _principled_ form of open nesting in the paper titled "Open 
Nesting in Software Transactional Memory" (
http://www.cse.msu.edu/~cse914/Readings/openNestingInSoftwareTransMemory-ppopp07.pdf)
 considered 
for clojure's STM? That paper (which I have nothing to do with) deals with 
the issue of an STM sometimes thinking two operations conflict due to 
conflicting reads and writes even though from the perspective of abstract 
data types the transactions shouldn't conflict, For example if one 
transaction modifies key X in a hashmap and another modifies key Y those 
transactions shouldn't conflict unless those two hashmap operations are 
executing at the same time and don't execute correctly. If the two 
operations occur at different times then those two operations needn't 
conflict, even if they happen to both write the same data e.g. incrementing 
a counter of the number of keys in the table. This sort of principled open 
nesting solves the problem that clojure's "commute" does but also handles 
cases when an operation commutes with _some_ other operations but not 
_all_, e.g. two hashmap writes to different keys don't conflict with each 
other but writes to the same key do.

Thanks in advance.
Warren

-- 
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

Reply via email to