From ec2574b09a746709f15d2a3f5de135e29f4bcb52 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Sun, 8 Jan 2017 11:18:16 -0800 Subject: Move to generic socket & pipe workers, and up to 4 each. This should eliminate all need for protocols to do their own thread management tasks. --- src/protocol/pipeline/pull.c | 10 +--------- src/protocol/pipeline/push.c | 9 +++------ 2 files changed, 4 insertions(+), 15 deletions(-) (limited to 'src/protocol/pipeline') diff --git a/src/protocol/pipeline/pull.c b/src/protocol/pipeline/pull.c index 9612177c..dc37e72b 100644 --- a/src/protocol/pipeline/pull.c +++ b/src/protocol/pipeline/pull.c @@ -139,22 +139,14 @@ nni_pull_sock_getopt(void *arg, int opt, void *buf, size_t *szp) static nni_proto_pipe_ops nni_pull_pipe_ops = { .pipe_init = nni_pull_pipe_init, .pipe_fini = nni_pull_pipe_fini, - .pipe_add = NULL, - .pipe_rem = NULL, - .pipe_send = NULL, - .pipe_recv = nni_pull_pipe_recv, + .pipe_worker = { nni_pull_pipe_recv }, }; static nni_proto_sock_ops nni_pull_sock_ops = { .sock_init = nni_pull_sock_init, .sock_fini = nni_pull_sock_fini, - .sock_close = NULL, .sock_setopt = nni_pull_sock_setopt, .sock_getopt = nni_pull_sock_getopt, - .sock_send = NULL, - .sock_recv = NULL, - .sock_rfilter = NULL, - .sock_sfilter = NULL, }; nni_proto nni_pull_proto = { diff --git a/src/protocol/pipeline/push.c b/src/protocol/pipeline/push.c index 6cdc9cc5..e3b9ace8 100644 --- a/src/protocol/pipeline/push.c +++ b/src/protocol/pipeline/push.c @@ -288,8 +288,8 @@ static nni_proto_pipe_ops nni_push_pipe_ops = { .pipe_fini = nni_push_pipe_fini, .pipe_add = nni_push_pipe_add, .pipe_rem = nni_push_pipe_rem, - .pipe_send = nni_push_pipe_send, - .pipe_recv = nni_push_pipe_recv, + .pipe_worker = { nni_push_pipe_send, + nni_push_pipe_recv }, }; static nni_proto_sock_ops nni_push_sock_ops = { @@ -298,10 +298,7 @@ static nni_proto_sock_ops nni_push_sock_ops = { .sock_close = nni_push_sock_close, .sock_setopt = nni_push_sock_setopt, .sock_getopt = nni_push_sock_getopt, - .sock_send = nni_push_sock_send, - .sock_recv = NULL, - .sock_rfilter = NULL, - .sock_sfilter = NULL, + .sock_worker = { nni_push_sock_send }, }; nni_proto nni_push_proto = { -- cgit v1.2.3-70-g09d2