[erlang-questions] What is the proper way of sending messages to pid from enif thread?
Tue Jul 7 18:40:47 CEST 2015
I just copy ErlNifPid to a C structure and use it from another thread. The environment used on that other thread was created with enif_alloc_env.
From: <erlang-questions-bounces@REDACTED> on behalf of Max Lapshin
Date: Tuesday 7 July 2015 18:30
To: Erlang-Questions Questions
Subject: [erlang-questions] What is the proper way of sending messages to pid from enif thread?
I've created thread in nif function. When I create thread, I know pid of caller:
But later in thread I need to create some environment and send message to this pid.
What is the proper way to save this ErlNifPid in C structure so that code in other thread will be able to send messages.
And as far as I understand, I need to call enif_alloc_env in that thread?
_______________________________________________ erlang-questions mailing list erlang-questions@REDACTED http://erlang.org/mailman/listinfo/erlang-questions
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the erlang-questions