From 6e482c5bb6bf49f000f6b8d35a1ca84127e38c46 Mon Sep 17 00:00:00 2001 From: Sylvain Munaut <tnt@246tNt.com> Date: Wed, 27 Jan 2016 12:58:50 +0100 Subject: gr-zeromq: Big rework for performance and correctness - Use class hierarchy trying to maximize code re-use. - Dont' drop samples on receive if the output buffer doesn't have enough space. - Don't drop tags on receive by putting tags in the future. - Better metadata creation/parsing avoiding copying lots data. - Always do as much work as possible in a single call to work() to avoid scheduler overhead as long as possible. - Allow setting the high watermark to avoid older version of zeromq's default of buffering infinite messages and causing a paging thrash to/from disk when the flow graph can't keep up. Signed-off-by: Sylvain Munaut <tnt@246tNt.com> --- gr-zeromq/lib/pull_source_impl.h | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) (limited to 'gr-zeromq/lib/pull_source_impl.h') diff --git a/gr-zeromq/lib/pull_source_impl.h b/gr-zeromq/lib/pull_source_impl.h index 757867998d..7d8ab53bd0 100644 --- a/gr-zeromq/lib/pull_source_impl.h +++ b/gr-zeromq/lib/pull_source_impl.h @@ -26,22 +26,15 @@ #include <gnuradio/zeromq/pull_source.h> #include <zmq.hpp> +#include "base_impl.h" + namespace gr { namespace zeromq { - class pull_source_impl : public pull_source + class pull_source_impl : public pull_source, public base_source_impl { - private: - size_t d_itemsize; - size_t d_vlen; - int d_timeout; // microseconds, -1 is blocking - zmq::context_t *d_context; - zmq::socket_t *d_socket; - bool d_pass_tags; - public: - pull_source_impl(size_t itemsize, size_t vlen, char *address, int timeout, bool pass_tags); - ~pull_source_impl(); + pull_source_impl(size_t itemsize, size_t vlen, char *address, int timeout, bool pass_tags, int hwm); int work(int noutput_items, gr_vector_const_void_star &input_items, -- cgit v1.2.3