<p dir="ltr">My suggestion is to call it from erlang when starting up your nif and save it to a thread local storage variable.</p>
<p dir="ltr">You can specify where a process is run with with spawn opt {scheduler,X} where X > 0<br></p>
<p dir="ltr">Regards,<br>
Sergej</p>
<div class="gmail_extra"><br><div class="gmail_quote">On Nov 5, 2016 1:35 PM, "Zhongzheng Liu" <<a href="mailto:liuzhongzheng2012@gmail.com">liuzhongzheng2012@gmail.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi mail list:<br>
<br>
We can use erlang:system_info(scheduler_<wbr>id) in Erlang code to know<br>
which scheduler the code is runing on.<br>
<br>
How to get this value inside nif ?<br>
<br>
<br>
Thanks<br>
<br>
Zhongzheng Liu<br>
______________________________<wbr>_________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" rel="noreferrer" target="_blank">http://erlang.org/mailman/<wbr>listinfo/erlang-questions</a><br>
</blockquote></div></div>