Thanks to Erlang’s NIF and linked-in driver interfaces, integrating native C/C++ code into the Erlang virtual machine (VM) is pretty straightforward. This is handy for integrating non-Erlang packages with Erlang applications, or for relieving performance bottlenecks by dropping to native code when measurements show a benefit to doing so. There’s one catch, though: native code has to execute in a millisecond or less to avoid wreaking havoc on the VM’s schedulers. Unfortunately, much native code is “dirty” and doesn’t follow these rules.
Erlang 17 has a new experimental feature called “dirty schedulers” designed to allow developers to integrate dirty native code with the Erlang VM. In this talk, Steve, who implemented dirty schedulers under the guidance of Rickard Green of the OTP team, will cover the details of how dirty schedulers work and how developers can use them to deal with dirty native code. He’ll also discuss future dirty scheduler work and related efforts.