From d0e30d8d70931ff0ba2d936ba35996e2f4e62ee5 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Fri, 29 Dec 2023 19:09:24 -0800 Subject: provide NNG_MAX_POLLER_THREADS This (defaults to 8) sets a limit on the number of poller threads that will be used for servicing I/Os. This is the size of the I/O completion port thread pool on Windows. POSIX pollers are generally not concurrent at present. --- CMakeLists.txt | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 04cc14de..226bb2eb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -138,6 +138,14 @@ if (NNG_MAX_EXPIRE_THREADS) add_definitions(-DNNG_MAX_EXPIRE_THREADS=${NNG_MAX_EXPIRE_THREADS}) endif() +# Poller threads. These threads run the pollers. This is mostly used +# on Windows right now, as the POSIX platforms use a single threaded poller. +set(NNG_MAX_POLLER_THREADS 8 CACHE STRING "Upper bound on I/O poller threads, 0 for no limit") +mark_as_advanced(NNG_MAX_POLLER_THREADS) +if (NNG_MAX_POLLER_THREADS) + add_definitions(-DNNG_MAX_POLLER_THREADS=${NNG_MAX_POLLER_THREADS}) +endif() + # Platform checks. if (CMAKE_C_COMPILER_ID STREQUAL "GNU") -- cgit v1.2.3-70-g09d2