aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2023-12-29 19:09:24 -0800
committerGarrett D'Amore <garrett@damore.org>2023-12-29 19:09:24 -0800
commitd0e30d8d70931ff0ba2d936ba35996e2f4e62ee5 (patch)
tree4a7d32a0c713926967bb23339a760d91adc814f3 /CMakeLists.txt
parent3298ac1e93742e7a1ef5c4dc2e9b603dfa89d3cb (diff)
downloadnng-d0e30d8d70931ff0ba2d936ba35996e2f4e62ee5.tar.gz
nng-d0e30d8d70931ff0ba2d936ba35996e2f4e62ee5.tar.bz2
nng-d0e30d8d70931ff0ba2d936ba35996e2f4e62ee5.zip
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.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt8
1 files changed, 8 insertions, 0 deletions
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")