[erlang-questions] Do you wanna play with enif_select?

Vans S <>
Fri Dec 2 16:47:36 CET 2016


The title intrigued me.

On line 148 of lib/kernel/test/netmarks_SUITE_data/sverk_tcp.c

+   cret = connect(sock, ai->ai_addr, ai->ai_addrlen);

Any idea what a good way would be to make this a non-blocking connect.
We obv want to avoid callback spaghetti in erlang, but we also want to avoid blocking
in the nifs?

Im thinking a try_connect select recursion func on the erlang side?

Or would blocking on the connect there in the NIF be fine now and not throw off the scheduler?

I noticed some files commited that are called after benchmark suites.  Any results of how performance fairs compared
to the built in net-io lib?



On Friday, December 2, 2016 10:22 AM, Sverker Eriksson <> wrote:
https://github.com/erlang/otp/pull/1264


This PR is introducing a new feature enif_select() as a way for
NIFs to ask for asynchronous notification when a file descriptor
(a socket for example) is ready for (more) reading or writing.

The API is not carved in stone yet and we would like some feedback.
So please, take enif_select for a spin and share your thoughts.

/Sverker, Erlang/OTP @ Ericsson


_______________________________________________
erlang-questions mailing list

http://erlang.org/mailman/listinfo/erlang-questions


More information about the erlang-questions mailing list