ps-lite icon indicating copy to clipboard operation
ps-lite copied to clipboard

About the lock in ZMQVan::SendMsg

Open microwish opened this issue 8 years ago • 1 comments

Might the granularity of the lock be smaller? I'm not sure.

I feel that reasons why the lock guards the whole function body are:

  1. protect senders_ from racing
  2. keep the data transfer to the socket continuously and avoid being interrupted

As for reason 1, smaller granularity is acceptable. As for reason 2, perhaps other operations than locking could be tried.

microwish avatar Mar 26 '17 23:03 microwish

@microwish SendMsg is an asynchronous call and will return immediately (http://api.zeromq.org/2-1:zmq-send), so the lock granularity does not matter too much in terms of the performance.

ymjiang avatar Jun 21 '19 12:06 ymjiang