nickdesaulniers/node-nanomsg — pull request #13 by blowback (2014-04-03 13:15:02+00:00)
Title: switch to single-threaded model

Whilst learning the ins and outs of async, threads etc in node and V8, I discovered that we're spawning a new worker thread in order to call (**non-blocking**) _nn_poll()_.

Since this call is asynchronous, it can be called from the event loop (i.e. does not need a separate worker thread). This makes the code significantly simpler, and provides a modest performance increase because of the saving in thread setup and synchronisation.

This PR can successfully execute the test suite in 3.3s (user) and 2.1s (sys) on average, versus 4.5s(user) and 3.3s (sys) on average for HEAD.

Is there some compelling reason that I'm not aware of why the poll needs to be in a separate thread?