[erlang-questions] Keeping massive concurrency when interfacing with C

Peer Stritzinger <>
Thu Oct 6 14:59:53 CEST 2011


On Wed, Oct 5, 2011 at 5:55 PM, Alceste Scalas <> wrote:
>
> In the second case, the future NIF extensions planned by OTP
> folks may be very useful --- see Rickard Green's talk at the SF
> Bay Area Erlang Factory 2011: http://bit.ly/eH61tX

Just watched the video and read the slides of this talk.

This would be perfect to handle more heavyweight numerical library
support.  Especially the dirty schedulers look very promising for
this.
Also the native processes which make it easy to run untrusted large
libraries in their own node.

> 1. if the vectors/matrices are "small enough", then the native
>    code could be called directly using NIFs;
>  2. otherwise, the operands could be passed to a separate worker
>     thread, which will later send back its result to the waiting
>     Erlang process (using enif_send()).

This won't be necessary if dirty schedulers are used if you look at slide 25 of
http://www.erlang-factory.com/upload/presentations/377/RickardGreen-NativeInterface.pdf
"Example of dirty scheduler use" you can see this two step solution
working with dirty schedulers without sending of messages and other
complications.

This is perfect for the numerical libraries.

Cheers
-- Peer Stritzinger



More information about the erlang-questions mailing list