[nanomsg] inproc changes

  • From: "Garrett D'Amore" <garrett@xxxxxxxxxx>
  • To: "nanomsg@xxxxxxxxxxxxx" <nanomsg@xxxxxxxxxxxxx>
  • Date: Tue, 24 Nov 2015 08:20:47 -0800

I just changed the inproc transport which should make it far more robust
and usable. Its still not perfect, and I believe some races are still to
be found (in fact I’m certain of it).

Nonetheless, what I do know is that it is now possible to use message
headers, and nn_device() with inproc, which has not been true for a long
time. A test of this, device7.c, is included in the tree.

Right now, from what I can tell, the main race conditions that exist
surround nn_term() and nn_close(). If your code uses neither of these, or
only does so at program exit, you’re unlikely to see problems.

Fixing those races is somewhat challenging, owing to the complexity of the
state machines, all of which have to be shut down safely, but any of which
may be fired by one of the others during shut down. Its quite possible
that I’m going to wind up deciding to use a Big Hammer, and hold a global
read/write lock during either nn_close or nn_shutdown, so that I can
cleanly stop everything. I’m not sure yet.

(The latest races seem to surround REQ/REP state machines racing against
nn_term or nn_close.)

- Garrett

Other related posts:

  • » [nanomsg] inproc changes - Garrett D'Amore