[erlang-questions] linked in driver port performance

Jarrod Roberson <>
Thu Jul 15 04:55:48 CEST 2010

On Wed, Jul 14, 2010 at 9:22 PM, Vinubalaji Gopal <>
> great so is NIF stable enough and the recommended solution for any kind of
> interfacing with C/C++?
> I read in the following link that NIF is good  for simple CPU bound
> operations and linked in port driver is good for IO  and fine grained
> concurrency. Is that not true anymore?

My understanding is NIF(s) are for one shot function calls that will block
the main Erlang thread.

>From the docs <http://ftp.sunet.se/pub/lang/erlang/doc/man/erl_nif.html>:

"*Avoid doing lengthy work in NIF calls as that may degrade the
responsiveness of the VM.
NIFs are called directly by the same scheduler thread that executed the
calling Erlang code.
The calling scheduler will thus be blocked from doing any other work until
the NIF returns*."

Jarrod Roberson

More information about the erlang-questions mailing list