On Wed, Sep 16, 2009 at 6:34 AM, Krukow <karl.kru...@gmail.com> wrote:

> Another interesting thing happened. I wrote another program using ref
> validators only.
>
> http://paste.lisp.org/display/87117#4
>
> That program does produce write-skews. Further, occasionally the
> program never terminates! I did (run 100) a few times on my core 2
> duo, and the program just looped.
>

I think you managed to produce a deadlock :-(

thread 1 is commiting and has a write lock on a1
thread 2 is commiting and has a write lock on a2
thread1 tries to acquire a read lock on a2 (in the validator) and blocks
because thread2 has a write lock on a2.
thread2 tries to acquire a read lock on a1 (in the validator) and blocks
because thread1 has a write lock on a1.


* are validators not meat to be used cross ref? I.e. validating a
> constraint across multiple refs.
>

I would say that you should not use validators for cross-constraints.
Reading the doc for ref, I'm not sure. We'll have to wait for Rich to
clarify.

Christophe

-- 
Professional: http://cgrand.net/ (fr)
On Clojure: http://clj-me.blogspot.com/ (en)

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