aboutsummaryrefslogtreecommitdiff
path: root/src/protocol/survey0
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2020-01-08 20:34:26 -0800
committerGarrett D'Amore <garrett@damore.org>2020-01-08 21:16:30 -0800
commitb21d7805523a407a14567017edbdef57ca81781f (patch)
treee07f08bdc047ee4dfb057b670766e3de5bf2f981 /src/protocol/survey0
parent8479b4c8861c77cfd9eb64e724615605bdd1cbcb (diff)
downloadnng-b21d7805523a407a14567017edbdef57ca81781f.tar.gz
nng-b21d7805523a407a14567017edbdef57ca81781f.tar.bz2
nng-b21d7805523a407a14567017edbdef57ca81781f.zip
fixes #1094 Consider in-lining task and aio
This only does it for rep, but it also has changes that should increase the overall test coverage for the REP protocol
Diffstat (limited to 'src/protocol/survey0')
-rw-r--r--src/protocol/survey0/respond.c8
-rw-r--r--src/protocol/survey0/survey.c12
-rw-r--r--src/protocol/survey0/xrespond.c20
-rw-r--r--src/protocol/survey0/xsurvey.c20
4 files changed, 30 insertions, 30 deletions
diff --git a/src/protocol/survey0/respond.c b/src/protocol/survey0/respond.c
index b4ffc917..06010d99 100644
--- a/src/protocol/survey0/respond.c
+++ b/src/protocol/survey0/respond.c
@@ -281,8 +281,8 @@ resp0_pipe_fini(void *arg)
nni_aio_set_msg(p->aio_recv, NULL);
nni_msg_free(msg);
}
- nni_aio_fini(p->aio_send);
- nni_aio_fini(p->aio_recv);
+ nni_aio_free(p->aio_send);
+ nni_aio_free(p->aio_recv);
}
static int
@@ -291,8 +291,8 @@ resp0_pipe_init(void *arg, nni_pipe *npipe, void *s)
resp0_pipe *p = arg;
int rv;
- if (((rv = nni_aio_init(&p->aio_recv, resp0_pipe_recv_cb, p)) != 0) ||
- ((rv = nni_aio_init(&p->aio_send, resp0_pipe_send_cb, p)) != 0)) {
+ if (((rv = nni_aio_alloc(&p->aio_recv, resp0_pipe_recv_cb, p)) != 0) ||
+ ((rv = nni_aio_alloc(&p->aio_send, resp0_pipe_send_cb, p)) != 0)) {
resp0_pipe_fini(p);
return (rv);
}
diff --git a/src/protocol/survey0/survey.c b/src/protocol/survey0/survey.c
index 8aa05dd4..35a14de7 100644
--- a/src/protocol/survey0/survey.c
+++ b/src/protocol/survey0/survey.c
@@ -286,9 +286,9 @@ surv0_pipe_fini(void *arg)
{
surv0_pipe *p = arg;
- nni_aio_fini(p->aio_getq);
- nni_aio_fini(p->aio_send);
- nni_aio_fini(p->aio_recv);
+ nni_aio_free(p->aio_getq);
+ nni_aio_free(p->aio_send);
+ nni_aio_free(p->aio_recv);
nni_msgq_fini(p->sendq);
}
@@ -303,9 +303,9 @@ surv0_pipe_init(void *arg, nni_pipe *npipe, void *s)
// is best effort, and a deep queue doesn't really do much for us.
// Note that surveys can be *outstanding*, but not yet put on the wire.
if (((rv = nni_msgq_init(&p->sendq, 16)) != 0) ||
- ((rv = nni_aio_init(&p->aio_getq, surv0_pipe_getq_cb, p)) != 0) ||
- ((rv = nni_aio_init(&p->aio_send, surv0_pipe_send_cb, p)) != 0) ||
- ((rv = nni_aio_init(&p->aio_recv, surv0_pipe_recv_cb, p)) != 0)) {
+ ((rv = nni_aio_alloc(&p->aio_getq, surv0_pipe_getq_cb, p)) != 0) ||
+ ((rv = nni_aio_alloc(&p->aio_send, surv0_pipe_send_cb, p)) != 0) ||
+ ((rv = nni_aio_alloc(&p->aio_recv, surv0_pipe_recv_cb, p)) != 0)) {
surv0_pipe_fini(p);
return (rv);
}
diff --git a/src/protocol/survey0/xrespond.c b/src/protocol/survey0/xrespond.c
index 66b340ee..6318fe8b 100644
--- a/src/protocol/survey0/xrespond.c
+++ b/src/protocol/survey0/xrespond.c
@@ -62,7 +62,7 @@ xresp0_sock_fini(void *arg)
{
xresp0_sock *s = arg;
- nni_aio_fini(s->aio_getq);
+ nni_aio_free(s->aio_getq);
nni_idhash_fini(s->pipes);
nni_mtx_fini(&s->mtx);
}
@@ -75,7 +75,7 @@ xresp0_sock_init(void *arg, nni_sock *nsock)
nni_mtx_init(&s->mtx);
if (((rv = nni_idhash_init(&s->pipes)) != 0) ||
- ((rv = nni_aio_init(&s->aio_getq, xresp0_sock_getq_cb, s)) != 0)) {
+ ((rv = nni_aio_alloc(&s->aio_getq, xresp0_sock_getq_cb, s)) != 0)) {
xresp0_sock_fini(s);
return (rv);
}
@@ -119,10 +119,10 @@ xresp0_pipe_fini(void *arg)
{
xresp0_pipe *p = arg;
- nni_aio_fini(p->aio_putq);
- nni_aio_fini(p->aio_getq);
- nni_aio_fini(p->aio_send);
- nni_aio_fini(p->aio_recv);
+ nni_aio_free(p->aio_putq);
+ nni_aio_free(p->aio_getq);
+ nni_aio_free(p->aio_send);
+ nni_aio_free(p->aio_recv);
nni_msgq_fini(p->sendq);
}
@@ -133,10 +133,10 @@ xresp0_pipe_init(void *arg, nni_pipe *npipe, void *s)
int rv;
if (((rv = nni_msgq_init(&p->sendq, 2)) != 0) ||
- ((rv = nni_aio_init(&p->aio_putq, xresp0_putq_cb, p)) != 0) ||
- ((rv = nni_aio_init(&p->aio_recv, xresp0_recv_cb, p)) != 0) ||
- ((rv = nni_aio_init(&p->aio_getq, xresp0_getq_cb, p)) != 0) ||
- ((rv = nni_aio_init(&p->aio_send, xresp0_send_cb, p)) != 0)) {
+ ((rv = nni_aio_alloc(&p->aio_putq, xresp0_putq_cb, p)) != 0) ||
+ ((rv = nni_aio_alloc(&p->aio_recv, xresp0_recv_cb, p)) != 0) ||
+ ((rv = nni_aio_alloc(&p->aio_getq, xresp0_getq_cb, p)) != 0) ||
+ ((rv = nni_aio_alloc(&p->aio_send, xresp0_send_cb, p)) != 0)) {
xresp0_pipe_fini(p);
return (rv);
}
diff --git a/src/protocol/survey0/xsurvey.c b/src/protocol/survey0/xsurvey.c
index 43c83793..86f912a2 100644
--- a/src/protocol/survey0/xsurvey.c
+++ b/src/protocol/survey0/xsurvey.c
@@ -60,7 +60,7 @@ xsurv0_sock_fini(void *arg)
{
xsurv0_sock *s = arg;
- nni_aio_fini(s->aio_getq);
+ nni_aio_free(s->aio_getq);
nni_mtx_fini(&s->mtx);
}
@@ -70,7 +70,7 @@ xsurv0_sock_init(void *arg, nni_sock *nsock)
xsurv0_sock *s = arg;
int rv;
- if ((rv = nni_aio_init(&s->aio_getq, xsurv0_sock_getq_cb, s)) != 0) {
+ if ((rv = nni_aio_alloc(&s->aio_getq, xsurv0_sock_getq_cb, s)) != 0) {
xsurv0_sock_fini(s);
return (rv);
}
@@ -116,10 +116,10 @@ xsurv0_pipe_fini(void *arg)
{
xsurv0_pipe *p = arg;
- nni_aio_fini(p->aio_getq);
- nni_aio_fini(p->aio_send);
- nni_aio_fini(p->aio_recv);
- nni_aio_fini(p->aio_putq);
+ nni_aio_free(p->aio_getq);
+ nni_aio_free(p->aio_send);
+ nni_aio_free(p->aio_recv);
+ nni_aio_free(p->aio_putq);
nni_msgq_fini(p->sendq);
}
@@ -136,10 +136,10 @@ xsurv0_pipe_init(void *arg, nni_pipe *npipe, void *s)
// an expiration with them, so that we could discard any that are
// not delivered before their expiration date.
if (((rv = nni_msgq_init(&p->sendq, 16)) != 0) ||
- ((rv = nni_aio_init(&p->aio_getq, xsurv0_getq_cb, p)) != 0) ||
- ((rv = nni_aio_init(&p->aio_putq, xsurv0_putq_cb, p)) != 0) ||
- ((rv = nni_aio_init(&p->aio_send, xsurv0_send_cb, p)) != 0) ||
- ((rv = nni_aio_init(&p->aio_recv, xsurv0_recv_cb, p)) != 0)) {
+ ((rv = nni_aio_alloc(&p->aio_getq, xsurv0_getq_cb, p)) != 0) ||
+ ((rv = nni_aio_alloc(&p->aio_putq, xsurv0_putq_cb, p)) != 0) ||
+ ((rv = nni_aio_alloc(&p->aio_send, xsurv0_send_cb, p)) != 0) ||
+ ((rv = nni_aio_alloc(&p->aio_recv, xsurv0_recv_cb, p)) != 0)) {
xsurv0_pipe_fini(p);
return (rv);
}