Skip to content

Commit 82512a1

Browse files
committed
doc vthreads sysprop in async ns
1 parent 03d6323 commit 82512a1

File tree

2 files changed

+15
-8
lines changed

2 files changed

+15
-8
lines changed

src/main/clojure/clojure/core/async.clj

+14-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,20 @@ core.async. If not supplied the ExecutorService for :io will be
4040
used instead.
4141
4242
The set of contexts may grow in the future so the function should
43-
return nil for unexpected contexts."
43+
return nil for unexpected contexts.
44+
45+
Use the Java system property `clojure.core.async.vthreads` to control
46+
how core.async uses JDK 21+ virtual threads. The property can be one of
47+
the following values:
48+
49+
\"unset\" - default to ioc when aot, always
50+
51+
\"target\" - target vthreads when compiling go and require them at runtime
52+
use vthreads in io-thread when available
53+
54+
\"avoid\" - use ioc when compiling go (will work regardless), do not use
55+
vthreads for io-thread
56+
"
4457
(:refer-clojure :exclude [reduce transduce into merge map take partition
4558
partition-by bounded-count])
4659
(:require [clojure.core.async.impl.protocols :as impl]

src/main/clojure/clojure/core/async/impl/dispatch.clj

+1-7
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,7 @@
7171
(def aot-compiling? clojure.core/*compile-files*)
7272

7373
(defn vthreads-directive-of
74-
"Returns the value of the sysprop clojure.core.async.vthreads, that can be one
75-
of three values:
76-
- \"unset\" = default to ioc when aot, always
77-
- \"target\" = target vthreads when compiling go and require them at runtime
78-
use vthreads in io-thread when available
79-
- \"avoid\" = use ioc when compiling go (will work regardless), do not use
80-
vthreads for io-thread"
74+
"Compares s to the value of the sysprop clojure.core.async.vthreads."
8175
[s]
8276
(= s (System/getProperty "clojure.core.async.vthreads")))
8377

0 commit comments

Comments
 (0)