[erlang-questions] NIF ErlNifEnv thread safety?
Thu Apr 23 17:54:44 CEST 2015
Can multiple threads safely use the same process-independent ErlNifEnv?
The documentation isn't clear to me. From
"Threads and concurrency
A NIF is thread-safe without any explicit synchronization as long as it
acts as a pure function and only reads the supplied arguments. As soon as
you write towards a shared state either through static variables or
enif_priv_data you need to supply your own explicit synchronization. This
includes terms in process independent environments that are shared between
threads. Resource objects will also require synchronization if you treat
them as mutable."
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the erlang-questions