Compare commits

...

4 Commits

Author SHA1 Message Date
Witold Kręcicki
3c2638dbde Revert "Make hazard pointers max_threads configurable at runtime."
This reverts commit e83951144b.
2019-12-13 14:36:36 +01:00
Witold Kręcicki
e83951144b Make hazard pointers max_threads configurable at runtime.
hp implementation requires an object for each thread accessing
a hazard pointer. previous implementation had a hardcoded
HP_MAX_THREAD value of 128, which failed on machines with lots of
CPU cores (named uses 3n threads). We make isc__hp_max_threads
configurable at startup, with the value set to 4*named_g_cpus.
It's also important for this value not to be too big as we do
linear searches on a list.
2019-12-12 23:41:57 +01:00
Witold Kręcicki
f527a5ed01 netmgr: set sock->listening in isc__nm_async_tcplisten always, even in case of errors, to avoid a deadlock. In case of a failure it will be cleared anyway 2019-12-12 22:55:57 +01:00
Witold Kręcicki
cd3f1f11cf netmgr: issue stop_udp_child synchronously only if we're in this sockets thread 2019-12-12 22:55:18 +01:00
2 changed files with 3 additions and 3 deletions

View File

@@ -335,9 +335,8 @@ isc__nm_async_tcplisten(isc__networker_t *worker, isc__netievent_t *ev0) {
}
}
atomic_store(&sock->listening, true);
done:
atomic_store(&sock->listening, true);
LOCK(&sock->lock);
SIGNAL(&sock->cond);
UNLOCK(&sock->lock);

View File

@@ -151,6 +151,7 @@ udp_close_cb(uv_handle_t *handle) {
static void
stop_udp_child(isc_nmsocket_t *sock) {
INSIST(sock->type == isc_nm_udpsocket);
INSIST(sock->tid == isc_nm_tid());
uv_udp_recv_stop(&sock->uv_handle.udp);
uv_close((uv_handle_t *) &sock->uv_handle.udp, udp_close_cb);
@@ -175,7 +176,7 @@ stoplistening(isc_nmsocket_t *sock) {
for (int i = 0; i < sock->nchildren; i++) {
isc__netievent_udpstop_t *event = NULL;
if (i == sock->tid) {
if (isc_nm_tid() == sock->tid) {
stop_udp_child(&sock->children[i]);
continue;
}