[erlang-questions] a question about NIFs

Paul Davis <>
Mon Nov 18 18:23:53 CET 2013


For Jiffy specifically, there was some work [1] on getting it to yield
back to the VM more regularly. I haven't had enough time lately to
test it thoroughly but Sergey Urbanovich has done some important
ground work there. I'd also point out that I've never actually had a
report that Jiffy was the cause of scheduler issues.

There's also the "+scl false +zdss true" VM flags [2] that disable
some of the scheduling logic that caused issues in the first place if
you're in a bind with a given NIF.

[1] https://github.com/davisp/jiffy/pull/49
[2] https://gist.github.com/slfritchie/5624609

On Mon, Nov 18, 2013 at 3:08 AM, Loïc Hoguin <> wrote:
> On 11/18/2013 04:51 AM, akonsu wrote:
>>
>> hello,
>>
>> I am looking at different erlang parsers for JSON, and many resources
>> that I found on the web reference jiffy
>> (https://github.com/davisp/jiffy) as one among the "fastest" parsers. I
>> am skeptical about this, having read articles about NIFs such as these
>> linked from
>>
>> http://stackoverflow.com/questions/18178542/why-does-the-nif-function-block-the-erlang-vm-from-scheduling-other-processes.
>> I am planning to run the parser in multiple worker processes, and it is
>> essential that the parser cooperates with the VM scheduler. Since I am
>> new to Erlang, I have no idea how to check this, so my question, I
>> think, is whether NIFs by definition are agnostic of the scheduler, thus
>> interfering with the normal VM activity.
>
>
> This is why many people choose https://github.com/talentdeficit/jsx instead.
>
> --
> Loïc Hoguin
> Erlang Cowboy
> Nine Nines
> http://ninenines.eu
>
> _______________________________________________
> erlang-questions mailing list
> 
> http://erlang.org/mailman/listinfo/erlang-questions



More information about the erlang-questions mailing list