[erlang-questions] linked in driver port performance

Jarrod Roberson jarrod@REDACTED
Thu Jul 15 04:55:48 CEST 2010


On Wed, Jul 14, 2010 at 9:22 PM, Vinubalaji Gopal <vinubalaji@REDACTED>
wrote:
> 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?
>
>
http://www.erlang-factory.com/upload/presentations/215/ErlangFactorySFBay2010-CliffMoon.pdf

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
www.vertigrated.com/blog


More information about the erlang-questions mailing list