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/include/gnuradio | |
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/include/gnuradio')
-rw-r--r-- | gr-zeromq/include/gnuradio/zeromq/pub_sink.h | 3 | ||||
-rw-r--r-- | gr-zeromq/include/gnuradio/zeromq/pull_source.h | 3 | ||||
-rw-r--r-- | gr-zeromq/include/gnuradio/zeromq/push_sink.h | 3 | ||||
-rw-r--r-- | gr-zeromq/include/gnuradio/zeromq/rep_sink.h | 3 | ||||
-rw-r--r-- | gr-zeromq/include/gnuradio/zeromq/req_source.h | 3 | ||||
-rw-r--r-- | gr-zeromq/include/gnuradio/zeromq/sub_source.h | 3 |
6 files changed, 12 insertions, 6 deletions
diff --git a/gr-zeromq/include/gnuradio/zeromq/pub_sink.h b/gr-zeromq/include/gnuradio/zeromq/pub_sink.h index e8871c22ac..e87c5522f9 100644 --- a/gr-zeromq/include/gnuradio/zeromq/pub_sink.h +++ b/gr-zeromq/include/gnuradio/zeromq/pub_sink.h @@ -53,9 +53,10 @@ namespace gr { * \param address ZMQ socket address specifier. * \param timeout Receive timeout in seconds, default is 100ms, 1us increments. * \param pass_tags Whether sink will serialize and pass tags over the link. + * \param hwm High Watermark to configure the socket to (-1 => zmq's default) */ static sptr make(size_t itemsize, size_t vlen, char *address, - int timeout=100, bool pass_tags=false); + int timeout=100, bool pass_tags=false, int hwm=-1); }; } // namespace zeromq diff --git a/gr-zeromq/include/gnuradio/zeromq/pull_source.h b/gr-zeromq/include/gnuradio/zeromq/pull_source.h index ca7b40726d..07cf6af128 100644 --- a/gr-zeromq/include/gnuradio/zeromq/pull_source.h +++ b/gr-zeromq/include/gnuradio/zeromq/pull_source.h @@ -50,9 +50,10 @@ namespace gr { * \param address ZMQ socket address specifier. * \param timeout Receive timeout in seconds, default is 100ms, 1us increments. * \param pass_tags Whether source will look for and deserialize tags. + * \param hwm High Watermark to configure the socket to (-1 => zmq's default) */ static sptr make(size_t itemsize, size_t vlen, char *address, - int timeout=100, bool pass_tags=false); + int timeout=100, bool pass_tags=false, int hwm=-1); }; } // namespace zeromq diff --git a/gr-zeromq/include/gnuradio/zeromq/push_sink.h b/gr-zeromq/include/gnuradio/zeromq/push_sink.h index 0f21b446b4..e2260aa3f6 100644 --- a/gr-zeromq/include/gnuradio/zeromq/push_sink.h +++ b/gr-zeromq/include/gnuradio/zeromq/push_sink.h @@ -54,9 +54,10 @@ namespace gr { * \param address ZMQ socket address specifier. * \param timeout Receive timeout in seconds, default is 100ms, 1us increments. * \param pass_tags Whether sink will serialize and pass tags over the link. + * \param hwm High Watermark to configure the socket to (-1 => zmq's default) */ static sptr make(size_t itemsize, size_t vlen, char *address, - int timeout=100, bool pass_tags=false); + int timeout=100, bool pass_tags=false, int hwm=-1); }; } // namespace zeromq diff --git a/gr-zeromq/include/gnuradio/zeromq/rep_sink.h b/gr-zeromq/include/gnuradio/zeromq/rep_sink.h index 33fd38b2df..220bd34416 100644 --- a/gr-zeromq/include/gnuradio/zeromq/rep_sink.h +++ b/gr-zeromq/include/gnuradio/zeromq/rep_sink.h @@ -52,9 +52,10 @@ namespace gr { * \param address ZMQ socket address specifier. * \param timeout Receive timeout in seconds, default is 100ms, 1us increments. * \param pass_tags Whether sink will serialize and pass tags over the link. + * \param hwm High Watermark to configure the socket to (-1 => zmq's default) */ static sptr make(size_t itemsize, size_t vlen, char *address, - int timeout=100, bool pass_tags=false); + int timeout=100, bool pass_tags=false, int hwm=-1); }; } // namespace zeromq diff --git a/gr-zeromq/include/gnuradio/zeromq/req_source.h b/gr-zeromq/include/gnuradio/zeromq/req_source.h index 9936406c23..461f653b43 100644 --- a/gr-zeromq/include/gnuradio/zeromq/req_source.h +++ b/gr-zeromq/include/gnuradio/zeromq/req_source.h @@ -50,9 +50,10 @@ namespace gr { * \param address ZMQ socket address specifier. * \param timeout Receive timeout in seconds, default is 100ms, 1us increments. * \param pass_tags Whether source will look for and deserialize tags. + * \param hwm High Watermark to configure the socket to (-1 => zmq's default) */ static sptr make(size_t itemsize, size_t vlen, char *address, - int timeout=100, bool pass_tags=false); + int timeout=100, bool pass_tags=false, int hwm=-1); }; } // namespace zeromq diff --git a/gr-zeromq/include/gnuradio/zeromq/sub_source.h b/gr-zeromq/include/gnuradio/zeromq/sub_source.h index 5fdd8932ec..def3a703e6 100644 --- a/gr-zeromq/include/gnuradio/zeromq/sub_source.h +++ b/gr-zeromq/include/gnuradio/zeromq/sub_source.h @@ -50,9 +50,10 @@ namespace gr { * \param address ZMQ socket address specifier. * \param timeout Receive timeout in seconds, default is 100ms, 1us increments. * \param pass_tags Whether source will look for and deserialize tags. + * \param hwm High Watermark to configure the socket to (-1 => zmq's default) */ static sptr make(size_t itemsize, size_t vlen, char *address, - int timeout=100, bool pass_tags=false); + int timeout=100, bool pass_tags=false, int hwm=-1); }; } // namespace zeromq |