diff options
author | Sylvain Munaut <tnt@246tNt.com> | 2016-01-27 12:58:50 +0100 |
---|---|---|
committer | Johnathan Corgan <johnathan@corganlabs.com> | 2016-01-27 10:31:26 -0800 |
commit | 6e482c5bb6bf49f000f6b8d35a1ca84127e38c46 (patch) | |
tree | ee9e4e3323da08dfabe91257229b970a38dff066 /gr-zeromq/lib/pull_source_impl.h | |
parent | 393624c072417e0b8a74480979eeccdfb8278e77 (diff) |
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>
Diffstat (limited to 'gr-zeromq/lib/pull_source_impl.h')
-rw-r--r-- | gr-zeromq/lib/pull_source_impl.h | 15 |
1 files changed, 4 insertions, 11 deletions
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, |