[nanomsg] mangos: review: device handles, abortable sockets

  • From: Garrett D'Amore <garrett@xxxxxxxxxx>
  • To: nanomsg@xxxxxxxxxxxxx
  • Date: Sun, 21 Dec 2014 11:26:17 -0800

(You can ignore this if you don’t use my Go implementation of nanomsg’s SP 
protocols.)

I’ve written a test bit of code for mangos that implements a new form of 
Device, that returns a struct, that can be started, and stopped.  It also 
required adding a new Abort() method to the Socket, that lets me start and stop 
sockets.

As now more people are using this stuff, I’d like some review before I commit.

The changes are here:

https://github.com/gdamore/mangos/commit/2564163479358b09091deeca849b54807c074555
 
<https://github.com/gdamore/mangos/commit/2564163479358b09091deeca849b54807c074555>

This new functionality is probably useful to some, but is not free.  In my 
testing, I found it adds between 300 and 1000 nanosecs (0.3 - 1 us) for full 
round trip latency, on my MacBook Pro (core i7 based).  This is on go1.3.  I’ve 
not tested go1.4 yet.

I’m not sure if folks are totally dependent on the latency aspects here.  Is 
the functionality worth the added cost?  I’m not sure.  So, I’m putting this 
out to the group.  I don’t have a strong opinion about it one way or the other 
— I neither need the new functionality, nor am I using this in contexts where 
the extra 150-500 ns per operation is likely to matter to me.  At least not yet.

Oh, and if you’ve got a suggestion as to how to get similar functionality 
without paying that cost, or other ideas for optimization, I’m all ears.

Thanks.

        - Garrett

Other related posts:

  • » [nanomsg] mangos: review: device handles, abortable sockets - Garrett D'Amore