Previously, we set the number of the hazard pointers to be 4 times the
number of workers because the dispatch ran on the old socket code.
Since the old socket code was removed there's a smaller number of
threads, namely:
- 1 main thread
- 1 timer thread
- <n> netmgr threads
- <n> threadpool threads
Set the number of hazard pointers to 2 + 2 * workers.
isc_timermgr_t *timermgr = NULL;
/*
- * We have ncpus network threads, ncpus old network threads - make
- * it 4x just to be on the safe side.
+ * Currently, there are:
+ * - 1 main thread
+ * - 1 timer thread
+ * - n netmgr threads
+ * - n threadpool threads
*/
- isc_hp_init(4 * workers);
+ isc_hp_init(2 + 2 * workers);
REQUIRE(netmgrp != NULL && *netmgrp == NULL);
isc__netmgr_create(mctx, workers, &netmgr);
#include <isc/atomic.h>
#include <isc/buffer.h>
#include <isc/condition.h>
+#include <isc/hp.h>
#include <isc/mutex.h>
#include <isc/netmgr.h>
#include <isc/nonce.h>
return (-1);
}
+ isc_hp_init(4 * workers);
+
signal(SIGPIPE, SIG_IGN);
return (0);