[erlang-questions] enif_send and non-SMP issues (enif_send: env==NULL on non-SMP VMAborted)

Anatoly Kanivetskiy chaos.a.d88@REDACTED
Fri Oct 12 00:41:33 CEST 2012


Hello, sirs!

Recently, under some dramatic circumstances, I have discovered that NIF's 
are doomed to brutal termination, when enif_send is called from spawned 
threads.
It forces me to just throw an exception during NIF initialization process, 
whenever erlang:system_info(smp_support) returns false.
As I understood, there is no general solution for this problem, and it can 
be tricky to gracefully handle this, since usually it forces you to think 
about two threading modes of your NIF at the same time.

So, the question to erlang masters: what will be your advice to all 
developers, which once will find that their nif's are not more 
cpu-topology-agnostic, and their applications fails to run on single-core 
environments?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20121011/3f2ea02f/attachment.htm>


More information about the erlang-questions mailing list