set_dvs_threads()
Set the process-wide thread pool size
set_dvs_threads() sets how many threads dvs uses for parallel file operations
(dvs_add(), dvs_get(), dvs_status()). The value is stored as the
dvs.num_threads option and synced to the dvs core before each operation. It is
process-wide; there is no per-call thread argument in R.
set_dvs_threads(threads)🔗Parameters
| Name | Type | Default | Behavior |
|---|---|---|---|
threads | integer(1) or NULL | required | Number of threads (must be a positive integer), or NULL to revert to automatic detection. |
Returns the previous value invisibly.
🔗Setup
options(width = 1000)
library(dvs)🔗Set a fixed thread count
Set a fixed number of threads. It takes effect on the next add, get, or status.
set_dvs_threads(2)
getOption("dvs.num_threads")[1] 2🔗Reset to automatic
Pass NULL to revert to automatic detection. The automatic default is
min(parallelism * 4, 16).
set_dvs_threads(NULL)
getOption("dvs.num_threads")NULL🔗Differences from the CLI
The CLI sets threads per call with --threads <N>, or process-wide with the
DVS_NUM_THREADS environment variable. The R setting is process-wide only; see
the --threads flag on any CLI command.