The threadpool implementation in core.async clojure library uses a FixedThreadPoolExecutor of size = # of cores * 2 + 42.
(defonce the-executor
(Executors/newFixedThreadPool
(-> (Runtime/getRuntime)
(.availableProcessors)
(* 2)
(+ 42))
(conc/counted-thread-factory "async-dispatch-%d" true)))
Is there a reason to use these numbers (# of cores times 2 plus 42) in particular? Is this optimal for all devices? I just want to know how did rich hickey (and contributors) settled with these numbers.
Thank you nullptr.
Here is the discussion for those who are interested: http://clojure-log.n01se.net/date/2013-08-29.html#15:45a
Some discussion at the link below, but it's basically arbitrary.
https://groups.google.com/d/msg/clojure/mT-r3EDeC74/dvaFqHnAZxgJ
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With