dmlc / ps-lite

A lightweight parameter server interface

Home Page:http://ps-lite.readthedocs.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

About the lock in ZMQVan::SendMsg

microwish opened this issue · 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 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.