<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<br>
<br>
<div class="moz-cite-prefix">On 04/23/2015 05:54 PM, Daniel Goertzen
wrote:<br>
</div>
<blockquote
cite="mid:CAJCf5Rzn_bcOsOPQXGSK8LufB0ZrDM-2u9SwbD2as3Yr2JZfZw@mail.gmail.com"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
<div dir="ltr">Can multiple threads safely use the same
process-independent ErlNifEnv? The documentation isn't clear to
me. From <a moz-do-not-send="true"
href="http://www.erlang.org/doc/man/erl_nif.html">http://www.erlang.org/doc/man/erl_nif.html</a>
...
<div><br>
</div>
"Threads and concurrency<br>
<br>
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."<br>
<br>
</div>
<br>
</blockquote>
Would it be clearer if "terms in" was removed from the third
sentence:<br>
<br>
"This includes process independent environments that are shared
between threads."<br>
<br>
<br>
/Sverker, Erlang/OTP<br>
</body>
</html>