[erlang-questions] How to get scheduler_id in nif?

Sergej Jurečko sergej.jurecko@REDACTED
Sat Nov 5 09:09:42 CET 2016


My suggestion is to call it from erlang when starting up your nif and save
it to a thread local storage variable.

You can specify where a process is run with with spawn opt {scheduler,X}
where X > 0

Regards,
Sergej

On Nov 5, 2016 1:35 PM, "Zhongzheng Liu" <liuzhongzheng2012@REDACTED>
wrote:

> Hi mail list:
>
> We can use erlang:system_info(scheduler_id) in Erlang code to know
> which scheduler the code is runing on.
>
> How to get this value inside nif ?
>
>
> Thanks
>
> Zhongzheng Liu
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20161105/9c23d351/attachment.htm>


More information about the erlang-questions mailing list