News for hackers. Stuff that matters.
Re:Erlang and code style by troutwine on Tuesday May 20, 2014 @07:49PM (#7775897)
It's worth noting that Erlang is only a soft-realtime language. I wouldn't bet my nuclear plant and only some assembly lines on it. (There's plenty I do bet on Erlang, though.)
Re:Erlang and code style by peerst on Wednesday May 21, 2014 @05:22AM (#7777296)
Soft is the new hard ;-) If you reason about hard realtime you pretty soon end up with the question: how high can the probability be that it misses a deadline. If you run on modern embedded CPU's with pipelines and caches its often all you can do (I am aware that some are modeling the CPU with caches, memory and everything to achieve 100% but thats very expensive and if you switch CPU's there is half a year worth of modeling down the drain)

The real world hard realtime systems often are built like: lets test it (with deadline miss triggering a failure) and if it works make sure we still have 10% of safety margin (which will later be melted down because of features ;-)

Re:Erlang and code style by jacquesm on Tuesday May 20, 2014 @07:52PM (#7775911)
That's valid, hard real time problems require guarantees that erlang can't give, that was an unwarranted exaggeration on my part. But anything that needs to be very long running (years or more) will need ironclad guarantees that it won't be leaking resources and I can't prove but suspect that erlang will do a lot better than go for those applications. Let's leave the nuclear plants and the assembly lines to RTos and QnX then :).
Re:Erlang and code style by peerst on Wednesday May 21, 2014 @05:27AM (#7777308)
"require guarantees that erlang can't give" ... at the moment, working on it.

In the meantime note that the percentage of stuff that really needs hard realtime in many systems is quite low. What I do at the moment is run Erlang on RTEMS (see my other posts) keep the hard realtime parts as simple as possible (always a good idea), write them in C and run them on a higher prio than the Erlang runtime which handles all the complicated things. Works like a breeze in practice

Re:Erlang and code style by phamilton on Tuesday May 20, 2014 @11:11PM (#7776517)
I wonder whether Erlang insome form could provide hard realtime guarantees. Something along the lines of LING.
Re:Erlang and code style by troutwine on Wednesday May 21, 2014 @12:32AM (#7776711)
It's an interesting question. I think you'd need at least:

  * a way to define scheduling requirements on a process level (beyond current, coarse, priority settings),
  * bounded process message queues (this would be handy in soft-realtime Erlang),
  * deadline accurate receives, 
  * accurate control over resource allocation
I've been meaning to sit down with some theory and think through this more analytically, but the above are my BART thinking-time derived set of requirements. I'm sure there are cases--some which would be obvious, in retrospect--that are not covered by the above.
Re:Erlang and code style by jacquesm on Wednesday May 21, 2014 @02:45AM (#7776984)
You'd have to run erlang directly on the hardware without an intermediary OS and you'd have to schedule the individual erlang processes using pre-emption and by giving them priorities. You'd also have to add a ready-list per priority.

After all, as long as BEAM is running as a child process of a host os that is not hard realtime you can't guarantee much of anything.

Re:Erlang and code style by peerst on Wednesday May 21, 2014 @05:12AM (#7777268)
Well Erlang is running on RTEMS in production in industrial control systems http://www.grisp.org

Hard realtime processes to come

Re:Erlang and code style by troutwine on Wednesday May 21, 2014 @04:15AM (#7777127)
Of course. Apologies, I assumed that was a given. A large part of the appeal of Erlang the Language is Erlang the VM and the two aren't often divorced.
Re:Erlang and code style by phamilton on Wednesday May 21, 2014 @09:55AM (#7778206)
Yeah, that's what I meant with LING (Erlang on xen).
Re:Erlang and code style by peerst on Wednesday May 21, 2014 @05:11AM (#7777265)
I have a project planned which when funded will give us hard realtime guarantees for certain Erlang processes.

This can only work of course if the underlying OS is also hard realtime capable. I have ported Erlang to the open source RTEMS http://www.rtems.org already. More details under http://www.grisp.org (sorry website not up to date but soon will be).