parquet_set_arrow_threads Subroutine

public subroutine parquet_set_arrow_threads(n)

Resizes Arrow's global CPU thread pool -- the single pool shared by every parquet_reader/parquet_writer in this process that has use_threads enabled (the default). This is NOT a per-reader/per-writer setting: call it once, e.g. near the start of your program, before opening readers/writers on other threads -- calling it concurrently from multiple threads with different values is a race, since it resizes a pool everyone else is also using at that moment.

Takes effect immediately, for readers/writers opened before the call as well as after. The first call records the previous capacity so parquet_reset_settings can restore it.

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: n

new thread-pool capacity; must be >= 1.


Source Code

    subroutine parquet_set_arrow_threads(n)
        integer, intent(in) :: n !! new thread-pool capacity; must be >= 1.

        if (n < 1) error stop "parquet_set_arrow_threads: n must be >= 1"
        if (cfg_arrow_threads_initial < 1) cfg_arrow_threads_initial = parquet_get_arrow_threads()
        call parquet_set_thread_pool_capacity(int(n, kind=c_int))
    end subroutine parquet_set_arrow_threads