On Dec 21, 2008, at 7:24 PM, Brian Doyle wrote:

I haven't been following the new atom stuff, so I was wondering why atom would be best in this
situation, vs a ref?  Thanks.


The implementation of atoms is supported by the JVM typically using a processor hardware instruction that accomplishes thread safety for a single location in a very focused, fast way.

From http://clojure.org/atoms :

Atoms are an efficient way to represent some state that will never need to be coordinated with any other, and for which you wish to make synchronous changes (unlike agents, which are similarly independent but asynchronous).

See also: http://www.ibm.com/developerworks/java/library/j-jtp11234/

--Steve

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to