Version française
Home     About     Download     Resources     Contact us    
Browse thread
Re: [Caml-list] Playing Soccer with OCaml
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Damien Doligez <damien.doligez@i...>
Subject: Re: [Caml-list] Playing Soccer with OCaml
>From: "Rafael 'Dido' Sevilla" <sevillar@team.ph.inter.net>

>Which brings me to a somewhat related question: just how real-time is
>OCaml's runtime environment?

In short: it has pretty good latency characteristics, but no real-time
guarantees.


>  Is the garbage collection algorithm
>real-time, i.e. it uses its own thread to perform GC in parallel to
>processing or uses some other technique which guarantees that every cons
>performed has an upper bound on the amount of time it will take,
>regardless of GC?

Note that using a separate thread to perform GC in parallel does not
by itself guarantee real-time behaviour.


>  Most garbage collection algorithms I've seen are not
>real-time, in that they can potentially take an unbounded amount of time
>that depends on the number of allocated cells.

In a real-time GC system, the programmer gives a guarantee that the
program will never have more than a fixed amount (declared in advance)
of live data, and the system gives a bound on the time needed to
perform each allocation.  Note that this bound has to be quite low in
order to make the real-time guarantees meaningful.  The memory
management of Objective Caml has low latency almost all the time,
thanks to the incremental GC, but we do not give a guaranteed bound.
Going all the way to real-time behaviour would be doable (with a lot
of work), but it would incur a large overhead, which we are not ready
to impose on "normal" users (compilers and proof assistants).

That said, I have to add that the normal behaviour of Objective Caml
on modern machines should be good enough for interactive games.  But
if you try to run rocket control algorithms with O'Caml, don't blame
us if it fails.


>  For robotics and other
>real-time control and processing problems this is an important question.

That's right, but Objective Caml is mainly targetted at Unix systems,
which generally do not support real-time anyway.

-- Damien
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr