One technique is to batch locks at a coarser granularity. You've explored both 
ends of the spectrum - 1 lock and N locks. You can also divide the overall 
vector into any group of refs between 1 and N.

If refs are too heavy, there are several other locking mechanisms on the JVM. 
You could try Clojure atoms or Java locks. Atoms can only be used to protect a 
single value so you would need a protocol for locking acquisition to deal with 
that. For something like that, you'd probably end up using a mutable data 
structure like a Java array.

-- 
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
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to