Although writing C code for NIFs is not a regular task for Erlang developers, it must be done with extreme care because not only a long-running NIF could degrade the responsiveness of the VM, but also when it crashes the whole VM will crash.<p>However when there is no other options except writing a NIF, there are ways to protect yourself:<p>1. Your NIF should return less than a millisecond.<p>2. If the item 1 is not possible, split it into shorter NIF calls.<p>3. If item 1 and 2 are not possible so you have a dirty NIF. It is a NIF that cannot be split and cannot execute in a millisecond or less. There is an <i>experimental</i> feature in Erlang virtual machine which is called &quot;dirty scheduler&quot;. When it is enabled some other schedulers are ready to execute the dirty NIFs, so they won&#x27;t interfere with the normal operation of schedulers.<p>4. If item 1 and 2 are not possible and you don&#x27;t want to use dirty schedulers, the +sfwi emulator flag is available to force normal schedulers to wake up again from the collapse situation.<p>These items are some solutions to remain in normal scheduling state even in case of writing the native functions in C (NIF), but what the article says is about just Erlang code which is run by schedulers and are preempted with no trouble as soon as they reach the reduction limit.