[nanomsg] Few Questions and Comments

  • From: Doron Somech <somdoron@xxxxxxxxx>
  • To: nanomsg@xxxxxxxxxxxxx
  • Date: Fri, 18 Apr 2014 20:04:18 +0300

I'm going over the nanomsg code, so far I think it's much simpler than
ZeroMQ (I ported zeromq to .net and thinking about doing the same for
nanomsg).

However I do have some questions:

* there is a critical section on the critical path of the library, every
time you send or receive a message there is a lock, zeromq doesn't have any
lock on the critical path, I understand this is in order to have simple
threading model, but isn't that expensive? because it's usually very short
waits, doesn't it be better to use user space lock? like spin lock?

* file descriptor is used for singaling when a message is ready or socket
is ready to send a message (same as zeromq), as I understand the only
reason FD is used instead of other signalling objects is to be able to use
it with a other file descriptor (not from nanomsg), the question is, giving
up this feature, will it be much faster to use other singaling objects?
maybe even lock-free user space objects?

Thanks,

Doron

Other related posts: