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

Van::GetTimestamp(), a bug or not?

microwish opened this issue · comments

include/ps/internal/van.h:

63 /**
64 * \brief get next available timestamp. thread safe
65 */
66 int GetTimestamp() { return timestamp_++; }

126 std::atomic timestamp_{0};

The implementation of GetTimestamp and its comment don't match. GetTimestamp doesn't get "next" availabe timestamp but the current logic timestamp.
Meanwhile timestamp_ is initialized as zero.
So the first call to GetTimestamp will return zero. Is it okay?