<blockquote>
<p>I think std::rand() is std::rand() is thread safe. </p>
</blockquote>

<p>Maybe yes, maybe no, it is implemented dependent as stephentu said, please check the answer of  <a href="http://stackoverflow.com/questions/6161322/using-stdlibs-rand-from-multiple-threads">stack overflow</a> if you want more info.</p>

<p>Besides, std::rand is quite old, c++11 provide us much better choice than std::rand(if std::rand is good enough for this case, just use it). You can check out this <a href="http://stackoverflow.com/questions/32927722/how-to-use-random-to-replace-rand">post </a>if you want to know std::rand or <code>&lt;random&gt;</code></p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">&mdash;<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly or <a href="https://github.com/mlpack/mlpack/pull/603#issuecomment-207152741">view it on GitHub</a><img alt="" height="1" src="https://github.com/notifications/beacon/AJ4bFM_2GnKKFsq2jlSZuds7MbXtkDL9ks5p1abEgaJpZM4H_54U.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
  <link itemprop="url" href="https://github.com/mlpack/mlpack/pull/603#issuecomment-207152741"></link>
  <meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>