<div dir="ltr">Hi.<div><br></div><div><br></div><div>I've created thread in nif function.  When I create thread, I know pid of caller:</div><div><br></div><div><div>  ErlNifPid self;</div><div>  enif_self(env, &self);</div></div><div><br></div><div><br></div><div>But later in thread I need to create some environment and send message to this pid.</div><div><br></div><div>What is the proper way to save this ErlNifPid in C structure so that code in other thread will be able to send messages.</div><div><br></div><div>And as far as I understand, I need to call  enif_alloc_env in that thread?</div><div><br></div></div>