Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

How easy is it to do real-time programming in Erlang? Would it be possible to get to 10 microsecond precision, to e.g. reliably drive a stepper motor directly from code?


10us is not generally achievable. Expect the lowest granularity you can get to be in the millisecond range. Erlang provides soft real-time, and under load you might see a process come later to the scheduler. You are guaranteed that the delay is somewhat fair over all processes though.

If you want harder real-time, it is usually better to have a specialized kernel handling that, locked to a CPU core, and then have the Erlang system orchestrate work as a control backplane for that kernel.


That’s one of the exciting points of this board using a true rtos. You can write real time tasks/threads for the RTEMS system. They mention the possibility of future Erlang bindings to do it as well.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: