Menu

zmq_recv_event.vi polls for POLLOUT

Stobber
2013-10-17
2013-10-22
  • Stobber

    Stobber - 2013-10-17

    This new VI polls for all events, including POLLOUT. Given the purpose of the VI, is there an opportunity for a performance improvement if the call to zmq_poll.vi is given "poll type" = [ZMQ_POLLIN && ZMQ_POLLERR] for every socket? It would eliminate the case structure inside the FOR loop.

    In this implementation, I'd also suggest replacing zmq_poll.vi with a modified copy of its code that initializes the "evt" array with the correct value and eliminates the Replace Array Subset prim.

     
  • Martijn Jasperse

    I had a go at making poll() more user friendly, it's now polymorphic as you suggested. I've changed recv_event to poll on POLLIN only, but the structure cannot be removed because if no data is received on a socket, it will return 0 for that socket, and recv() will hang waiting for data.

     
  • Stobber

    Stobber - 2013-10-18

    Very nice, thank you! Incidentally, the polymorphic VI doesn't have an icon that matches the library template, so it looks wrong in the functions palette. And the "Array type" instance is the default, while the "Scalar type" instance will execute faster (by a trivial fraction). I recommend setting the poly VI to show its selector by default.

     

    Last edit: Stobber 2013-10-18
  • Martijn Jasperse

    I've updated it in v1.5.2.83. POLLERR got removed because apparently it doesn't do anything anyway.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.