<div dir="ltr"><div>Hi,</div><div>I just started to write some nif code to interface towards a Linux driver API.</div><div>I can install a callback function in my nif module that gets called from the driverĀ  whenever it is ready to receive new data. Currently it gets called every 5 ms. The callback function sends a message to an erlang process that in turn delivers new data to the driver. (Using another nif function).</div><div><br></div><div>This works, although I am a bit puzzled how, since the callback function that is called from the linux driver appearantly is running outside the Erlang VM and still is able to send a message to the erlang process. Could anyone explain how this works?</div><div><br></div><div>Also when loaded with a lot of data I am not capable of delivering in time (5 ms) unless I set the process_flag(priority, high). I noticed there is a enif_select function that I can use instead but this also sends a message to an erlang process so I am not sure if there is any timing difference between using enif_select or sending an erlang message directly from a driver callback?</div><div><br></div><div>Thanks, <br></div><div>Mikael</div><div><br></div></div>