On Jul 1, 12:02 am, Chouser <chou...@gmail.com> wrote: > You could wrap a Ref around every value, if you chose, to > allow independent changes to different "rows" at the same > time -- though this would not help when inserting rows.
I guess having millions of Refs would not perform too well. Plus you don't need that level of concurrency any time soon, I guess (and hope). > You could partition your key space somehow (perhaps by hash) > to allow n groups of rows, and protect each of those with > a Ref. This would allow insertions and deletions > independently as long as the operations were being applied > to different groups. Sounds feasible and reminds me of the lock striping done in ConcurrentHashMap. It would allow me to use a number of refs that depends on the number of available processors. One thing that I wonder is whether this data structure should be written in Java or in Clojure. Is there any other database implemented in clojure besides contrib.datalog? contrib.datalog doesn't have (write) concurrency and it looks like that is something that cannot be added without changing the interface. I'm basically looking for a database that allows the (clojure) user to listen on database updates that match certain criteria, just like the "observers" in the "Functional Relational Model" paper by Moseley and Marks. But it looks like I have to implement that myself - which is not a complaint, but I'm trying to estimate the amount of work necessary. But I guess I could just start with one Ref per relation and then make it more concurrent later - if I choose an interface that allows it. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---