Common vars.

(ns cljam.common)

The number of threads.

(def ^:dynamic *n-threads*
  1)

Returns the actual number of threads that will be used for executions. n-threads itself will be used if it is more than zero. Otherwise, (processors + 3) will be used. Note that this return value includes the main thread.

(defn get-exec-n-threads
  ^long
  []
  (if (pos? (long *n-threads*))
    *n-threads*
    (+ 3 (.. Runtime getRuntime availableProcessors))))