caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Brian Hurt <bhurt@spnz.org>
To: Basile Starynkevitch <basile.starynkevitch@inria.fr>
Cc: Ocaml Mailing List <caml-list@inria.fr>
Subject: Re: [Caml-list] Real Time Ocaml
Date: Mon, 19 Apr 2004 19:20:38 -0500 (CDT)	[thread overview]
Message-ID: <Pine.LNX.4.44.0404191911490.6919-100000@localhost.localdomain> (raw)
In-Reply-To: <20040416075542.GA1500@bourg.inria.fr>

On Fri, 16 Apr 2004, Basile Starynkevitch wrote:

> I do not think that re-coding the Ocaml runtime system for hard
> real-time performance is really realistic (it is doable, but it is a
> big task, requiring significant expertise), and I suspect that the
> resulting system would be slower than today's Ocaml, and will perform
> worse. Real-time garbage collection is tricky and costly (perhaps even
> needing some kind of read barrier). If you recode the Ocaml GC, you
> either have to recode the bytecode interpreter or heavily change some
> tricky parts of the ocamlopt native code generator.
> 

First off, having worked in the realtime world, realtime does not mean
fast.  Quite the contrary, often.  What realtime means is that I can set
deadlines, that a certain amount of work needs to be done within a given
time, and can test and prove that the work will, indeed, be done.  Soft
realtime generally means that missing a deadline, while bad, is not
catastrophic.  Examples include music and video recording/playback.  
Missing a deadline means a skip.  Hard realtime means that there are
catastrophic consequences for missing a deadline- generally, lawyers get
involved if you miss the deadline.  An example here is the brake
controller on your car.  Slower isn't the problem, so long as it's a
constant slower.  It's large differences in time between "common case" and
"worst case".

The only thing non-realtime in Ocaml is the garbage collection.  There are
realtime garbage collectors, which do a certain amount of work every
allocation, so that a) the cost of every allocation is constant (or close
enough), and b) that all the work the collector ever needs to do is 
distributed evenly among the allocations.  The current collector, while 
perfect for non-realtime tasks (due to it's small average cost) is 
horrible for realtime because of the huge difference between the common 
case (5 instructions) and the worst case (mass collection)>

-- 
"Usenet is like a herd of performing elephants with diarrhea -- massive,
difficult to redirect, awe-inspiring, entertaining, and a source of
mind-boggling amounts of excrement when you least expect it."
                                - Gene Spafford 
Brian

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


  parent reply	other threads:[~2004-04-20  0:16 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-04-14 16:12 Erol Akarsu
2004-04-14 17:07 ` Basile STARYNKEVITCH
2004-04-15  6:51   ` Kenneth Knowles
2004-04-15 18:44     ` Brian Hurt
2004-04-16  7:55       ` Basile Starynkevitch
2004-04-16 12:33         ` Erol Akarsu
2004-04-16 15:12           ` skaller
2004-04-20  0:20         ` Brian Hurt [this message]
2004-04-20  0:31           ` Karl Zilles
2004-04-20  1:50             ` skaller
2004-04-14 18:21 ` Jon Harrop
2004-04-15  8:17 ` Hendrik Tews
2004-04-15 22:33   ` Erol Akarsu
2004-04-20  8:04     ` Hendrik Tews
2004-04-20 13:44       ` Eric Dahlman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.44.0404191911490.6919-100000@localhost.localdomain \
    --to=bhurt@spnz.org \
    --cc=basile.starynkevitch@inria.fr \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).