mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-29 05:28:00 +00:00
Use multiple worker queues (using isc_task_sendto()) in unix socket code
This commit is contained in:
parent
559ce1e330
commit
c1a4f0e66a
@ -2802,13 +2802,15 @@ send_recvdone_event(isc__socket_t *sock, isc_socketevent_t **dev) {
|
||||
|
||||
(*dev)->ev_sender = sock;
|
||||
|
||||
if (ISC_LINK_LINKED(*dev, ev_link))
|
||||
if (ISC_LINK_LINKED(*dev, ev_link)) {
|
||||
ISC_LIST_DEQUEUE(sock->recv_list, *dev, ev_link);
|
||||
}
|
||||
|
||||
if (((*dev)->attributes & ISC_SOCKEVENTATTR_ATTACHED) != 0) {
|
||||
isc_task_sendanddetach(&task, (isc_event_t **)dev);
|
||||
isc_task_sendtoanddetach(&task, (isc_event_t **)dev,
|
||||
sock->threadid);
|
||||
} else {
|
||||
isc_task_send(task, (isc_event_t **)dev);
|
||||
isc_task_sendto(task, (isc_event_t **)dev, sock->threadid);
|
||||
}
|
||||
}
|
||||
|
||||
@ -2830,9 +2832,10 @@ send_senddone_event(isc__socket_t *sock, isc_socketevent_t **dev) {
|
||||
ISC_LIST_DEQUEUE(sock->send_list, *dev, ev_link);
|
||||
|
||||
if (((*dev)->attributes & ISC_SOCKEVENTATTR_ATTACHED) != 0) {
|
||||
isc_task_sendanddetach(&task, (isc_event_t **)dev);
|
||||
isc_task_sendtoanddetach(&task, (isc_event_t **)dev,
|
||||
sock->threadid);
|
||||
} else {
|
||||
isc_task_send(task, (isc_event_t **)dev);
|
||||
isc_task_sendto(task, (isc_event_t **)dev, sock->threadid);
|
||||
}
|
||||
}
|
||||
|
||||
@ -2853,7 +2856,7 @@ send_connectdone_event(isc__socket_t *sock, isc_socket_connev_t **dev) {
|
||||
if (ISC_LINK_LINKED(*dev, ev_link))
|
||||
ISC_LIST_DEQUEUE(sock->connect_list, *dev, ev_link);
|
||||
|
||||
isc_task_sendanddetach(&task, (isc_event_t **)dev);
|
||||
isc_task_sendtoanddetach(&task, (isc_event_t **)dev, sock->threadid);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -3110,7 +3113,7 @@ internal_accept(isc__socket_t *sock) {
|
||||
task = dev->ev_sender;
|
||||
dev->ev_sender = sock;
|
||||
|
||||
isc_task_sendanddetach(&task, ISC_EVENT_PTR(&dev));
|
||||
isc_task_sendtoanddetach(&task, ISC_EVENT_PTR(&dev), sock->threadid);
|
||||
return;
|
||||
|
||||
soft_error:
|
||||
@ -4896,7 +4899,7 @@ isc_socket_connect(isc_socket_t *sock0, const isc_sockaddr_t *addr,
|
||||
if (sock->connected) {
|
||||
INSIST(isc_sockaddr_equal(&sock->peer_address, addr));
|
||||
dev->result = ISC_R_SUCCESS;
|
||||
isc_task_send(task, ISC_EVENT_PTR(&dev));
|
||||
isc_task_sendto(task, ISC_EVENT_PTR(&dev), sock->threadid);
|
||||
|
||||
UNLOCK(&sock->lock);
|
||||
|
||||
@ -4960,7 +4963,7 @@ isc_socket_connect(isc_socket_t *sock0, const isc_sockaddr_t *addr,
|
||||
|
||||
err_exit:
|
||||
sock->connected = 0;
|
||||
isc_task_send(task, ISC_EVENT_PTR(&dev));
|
||||
isc_task_sendto(task, ISC_EVENT_PTR(&dev), sock->threadid);
|
||||
|
||||
UNLOCK(&sock->lock);
|
||||
inc_stats(sock->manager->stats,
|
||||
@ -4976,7 +4979,7 @@ isc_socket_connect(isc_socket_t *sock0, const isc_sockaddr_t *addr,
|
||||
sock->connected = 1;
|
||||
sock->bound = 1;
|
||||
dev->result = ISC_R_SUCCESS;
|
||||
isc_task_send(task, ISC_EVENT_PTR(&dev));
|
||||
isc_task_sendto(task, ISC_EVENT_PTR(&dev), sock->threadid);
|
||||
|
||||
UNLOCK(&sock->lock);
|
||||
|
||||
@ -5262,8 +5265,8 @@ isc_socket_cancel(isc_socket_t *sock0, isc_task_t *task, unsigned int how) {
|
||||
|
||||
dev->result = ISC_R_CANCELED;
|
||||
dev->ev_sender = sock;
|
||||
isc_task_sendanddetach(¤t_task,
|
||||
ISC_EVENT_PTR(&dev));
|
||||
isc_task_sendtoanddetach(¤t_task,
|
||||
ISC_EVENT_PTR(&dev), sock->threadid);
|
||||
}
|
||||
|
||||
dev = next;
|
||||
|
Loading…
x
Reference in New Issue
Block a user