On 11/08/2016 03:11 AM, Zhongzheng Liu wrote: > I am trying to make my nif lock free like erlang:make_ref/0 and > erlang:unique_integer/0 in OTP 18+ > > > Why not use the enif_tsd_* interface (thread specific data) and create your own unique id for each calling thread. /Sverker, Erlang/OTP