I guess the core.async library creates a thead pool. In the library code:
(defonce the-executor
(Executors/newFixedThreadPool
(-> (Runtime/getRuntime)
(.availableProcessors)
(* 2)
(+ 42))
(conc/counted-thread-factory "async-dispatch-%d" true)))
On my machine it turns
Hi Laurens,
I am pretty sure (thread ...) only executes once. To check this I evaluated
(dotimes [i 100] (log "foo"))
in the REPL and the thread count goes from 23 to 80. On subsequent
evaluations of (dotimes [i 100] (log "foo")), the count stays at 78.
Thanks
Nico.
On Monday, October 13
Hi Nico,
Just to rule out the obvious: you’re not recompiling that namespace ever time,
right? Because if you call (thread …) a bunch of times, you’re gonna get a
bunch of threads :-)
cheers
lvh
On 13 Oct 2014, at 14:21, Nico Swart wrote:
> I am experimenting with core.async and I am us