title: Is clojure "multithread"?
body: <p>My question may seem weird but I think I'm facing an issue with <code>volatile</code> objects.</p>
  
  <p>I have written a library implemented like this (just a scheme, not real content):</p>
  
  <pre><code>(def var1 (volatile! nil))
  (def var2 (volatile! nil))
  
  (def do-things [a]
   (vreset! var1 a)
   (vswap! var2 (inc @var2))
   {:a @var1 :b @var2})
  </code></pre>
  
  <p>So I have global var which are initialized by external values, others that are calculated and I return their content. 
  i used volatile to have better speed than with atoms and not to redefine everytime a new var for every calculation.</p>
  
  <p>The problem is that this seems to fail in practice because I <code>map</code> do-things to a collection (in another program) with inner sub-calls to this function occasionaly, like (pseudo-code) :</p>
  
  <pre><code>(map 
    (fn [x] 
      (let [analysis (do-things x)] 
        (if blabla 
            (do-things (f x)) 
            analysis)))) coll)
  </code></pre>
  
  <p>Will inner conditionnal call spawn another thread under the hood ? It seems yes because somethimes calls work, sometimes not.
  is there any other way to do apart from defining volatile inside every <code>do-things</code> body ?</p>
  
  <p><strong>EDIT</strong> </p>
  
  <p>Actually the error was another thing but the question is still here : is this an acceptable/safe way to do without any explicit call to multithreading capabilities ?</p>