Liking cljdoc? Tell your friends :D

embroidery.api


bounded-pmap*clj

(bounded-pmap* n f coll)

Version of pmap which uses JVM 21+ virtual threads when available, but will chunk the work up such that at most n concurrent virtual threads will be used (useful for workloads where system resource constraints could be exceeded e.g. maximum number of open file handles).

Notes:

  • degrades to vanilla pmap on JVMs that don't support virtual threads
  • virtual thread version is partially lazy (results are computed eagerly, but merged lazily using concat)
  • non virtual thread version ignores the n argument (since pmap chunks coll itself, based on the number of CPUs)
  • each invocation of bounded-pmap* utilises an independent set of virtual threads, so parallel invocations may exceed system resource constraints
Version of [pmap](https://clojure.github.io/clojure/clojure.core-api.html#clojure.core/pmap)
which uses JVM 21+ virtual threads when available, but will chunk the work up
such that at most `n` concurrent virtual threads will be used (useful for
workloads where system resource constraints could be exceeded e.g. maximum
number of open file handles).

Notes:

* degrades to vanilla [pmap](https://clojure.github.io/clojure/clojure.core-api.html#clojure.core/pmap)
  on JVMs that don't support virtual threads
* virtual thread version is partially lazy (results are computed eagerly, but
  merged lazily using [concat](https://clojure.github.io/clojure/clojure.core-api.html#clojure.core/concat))
* non virtual thread version ignores the `n` argument (since [pmap](https://clojure.github.io/clojure/clojure.core-api.html#clojure.core/pmap)
  chunks `coll` itself, based on the number of CPUs)
* each invocation of `bounded-pmap*` utilises an independent set of virtual
  threads, so parallel invocations may exceed system resource constraints
sourceraw docstring

future*cljmacro

(future* & body)

Version of future which uses JVM 21+ virtual threads when available.

Notes:

  • degrades to vanilla future on JVMs that don't support virtual threads
Version of [future](https://clojure.github.io/clojure/clojure.core-api.html#clojure.core/future)
which uses JVM 21+ virtual threads when available.

Notes:

* degrades to vanilla [future](https://clojure.github.io/clojure/clojure.core-api.html#clojure.core/future)
  on JVMs that don't support virtual threads
sourceraw docstring

future-call*clj

(future-call* f)

Version of future-call that uses JVM 21+ virtual threads when available.

Notes:

  • degrades to vanilla future-call on JVMs that don't support virtual threads
Version of [future-call](https://clojure.github.io/clojure/clojure.core-api.html#clojure.core/future-call)
that uses JVM 21+ virtual threads when available.

Notes:

* degrades to vanilla [future-call](https://clojure.github.io/clojure/clojure.core-api.html#clojure.core/future-call)
  on JVMs that don't support virtual threads
sourceraw docstring

pmap*clj

(pmap* f coll)

Version of pmap which uses JVM 21+ virtual threads when available, one per item in coll.

Notes:

  • degrades to vanilla pmap on JVMs that don't support virtual threads
  • virtual thread version is not lazy
Version of [pmap](https://clojure.github.io/clojure/clojure.core-api.html#clojure.core/pmap)
which uses JVM 21+ virtual threads when available, one per item in `coll`.

Notes:

* degrades to vanilla [pmap](https://clojure.github.io/clojure/clojure.core-api.html#clojure.core/pmap)
  on JVMs that don't support virtual threads
* virtual thread version is _not_ lazy
sourceraw docstring

virtual-threads-in-use?clj

Are virtual threads in use on this JVM?

Are virtual threads in use on this JVM?
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close