aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt12
1 files changed, 11 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ef4c2bc8..eaf77c9a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,5 +1,5 @@
#
-# Copyright 2021 Staysail Systems, Inc. <info@staysail.tech>
+# Copyright 2023 Staysail Systems, Inc. <info@staysail.tech>
# Copyright (c) 2012 Martin Sustrik All rights reserved.
# Copyright (c) 2013 GoPivotal, Inc. All rights reserved.
# Copyright (c) 2015-2016 Jack R. Dunaway. All rights reserved.
@@ -130,6 +130,16 @@ if (NNG_MAX_TASKQ_THREADS)
add_definitions(-DNNG_MAX_TASKQ_THREADS=${NNG_MAX_TASKQ_THREADS})
endif ()
+# Expire threads. This runs the timeout handling, and having more of them
+# reduces contention on the common locks used for aio expiration.
+# The default is to allocate up to max(8, ncpu). The upper limit can be
+# overridden here.
+set(NNG_MAX_EXPIRE_THREADS 8 CACHE STRING "Upper bound on expire threads, 0 for no limit")
+mark_as_advanced(NNG_MAX_EXPIRE_THREADS)
+if (NNG_MAX_EXPIRE_THREADS)
+ add_definitions(-DNNG_MAX_EXPIRE_THREADS=${NNG_MAX_EXPIRE_THREADS})
+endif()
+
# Platform checks.
if (CMAKE_C_COMPILER_ID STREQUAL "GNU")