On Dec 22, 5:45 am, "Mark Engelberg" <mark.engelb...@gmail.com> wrote:
> But if mk-counter is called twice because it's retried in part of a
> transaction, then you're in big trouble when you use atom. Better to
> use a ref here. atom needs to be reserved for the very few cases when
> retries don't matter (like a cache).
If I understand it right, as long as the "counter" is used
within a single thread and not across threads there shouldn't
be any issues. Same as a cache.
If the idea is to use one counter across multiple threads
then refs can be used.
I don't think I follow why mk-counter would be retried. There
is not reason for it to fail as it simply creates a new "counter"
and returns it and doesn't need to block or be blocked.
Parth
--~--~---------~--~----~------------~-------~--~----~
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
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
-~----------~----~----~----~------~----~------~--~---