Watch behavior varies a bit by ref type, I believe. You'll probably
want to look into the details of the specific ref type you're using.

for atoms and refs, I believe the watch is done on the thread that's
updating the ref. Since retries can occur you can't really count on
ordering. You could create your own thread to single thread the action
- I've done that in the past with success. While you can't rely on
ordering, having the old and new value to diff might be enough to know
what actions you want to perform in your watch (on your single thread)

for agents, I believe everything will be single threaded and in the
order of agent updates.

On Fri, Sep 13, 2013 at 8:04 AM, gixxi
<christian.meichs...@informatik.tu-chemnitz.de> wrote:
> Hi,
>
> i got a question on reference type instances with attached watches.
>
> Consider a reference type instance R with a watch W attached by (add-watch R
> :watcher #(...)) and
>
> a n parallel activities committing a transition to R in some monotonic order
> 0..n-1.
>
> Does Clojure ensure that the function calls by the watch dog are executed in
> the very same order? Is it possible to wrap the watch dog notification in a
> synchronisation block?
>
> Thanks in advance
>
> Best regards
>
> Christian
>
> --
> --
> 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/groups/opt_out.

-- 
-- 
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/groups/opt_out.

Reply via email to