Skip to content

Commit

Permalink
ASYNC-260 Remove now unused pool-size property and var
Browse files Browse the repository at this point in the history
  • Loading branch information
puredanger committed Mar 10, 2025
1 parent 59f4952 commit e0ba619
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 20 deletions.
9 changes: 2 additions & 7 deletions src/main/clojure/clojure/core/async.clj
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@
(ns clojure.core.async
"Facilities for async programming and communication.
go blocks are dispatched over an internal thread pool, which
defaults to 8 threads. The size of this pool can be modified using
the Java system property `clojure.core.async.pool-size`.
Set Java system property `clojure.core.async.go-checking` to true
to validate go blocks do not invoke core.async blocking operations.
Property is read once, at namespace load time. Recommended for use
Expand Down Expand Up @@ -58,9 +54,8 @@ return nil for unexpected contexts."
)
(:import [java.util.concurrent.atomic AtomicLong]
[java.util.concurrent.locks Lock]
[java.util.concurrent Executors Executor ThreadLocalRandom]
[java.util Arrays ArrayList]
[clojure.lang Var]))
[java.util.concurrent ThreadLocalRandom]
[java.util Arrays ArrayList]))

(alias 'core 'clojure.core)

Expand Down
15 changes: 2 additions & 13 deletions src/main/clojure/clojure/core/async/impl/dispatch.clj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

(ns ^{:skip-wiki true}
clojure.core.async.impl.dispatch
(:require [clojure.core.async.impl.protocols :as impl])
(:import [java.util.concurrent Executors ExecutorService ThreadFactory]))

(set! *warn-on-reflection* true)
Expand Down Expand Up @@ -36,16 +35,6 @@
(.setName (format name-format (swap! counter inc)))
(.setDaemon daemon))))))))

(defonce
^{:doc "Number of processors reported by the JVM"}
processors (.availableProcessors (Runtime/getRuntime)))

(def ^:private pool-size
"Value is set via clojure.core.async.pool-size system property; defaults to 8; uses a
delay so property can be set from code after core.async namespace is loaded but before
any use of the async thread pool."
(delay (or (Long/getLong "clojure.core.async.pool-size") 8)))

;; used only for implementing go-checking
(def ^:private ^:dynamic *in-go-dispatch* false)

Expand All @@ -69,8 +58,8 @@
nil)

(defn- make-ctp-named
[workflow]
(Executors/newCachedThreadPool (counted-thread-factory (str "async-" (name workflow) "-%d") true)))
[workload]
(Executors/newCachedThreadPool (counted-thread-factory (str "async-" (name workload) "-%d") true)))

(defn ^:private create-default-executor
[workload]
Expand Down

0 comments on commit e0ba619

Please sign in to comment.