Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
Cancel button or Status bar
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2008-02-17 (22:03)
From: Angela Zhu <angela22.zhu@g...>
Subject: Re: [Caml-list] Cancel button or Status bar
On Feb 16, 2008 11:26 AM, Dominique Martinet <> wrote:

> Hello,
> If it's an OCaml interpreter, I don't think there's a way to evaluate
> the time needed automatically, you can compute the complexity yourself
> and have a rough evaluation of the compile time, but there's no way a
> computer will do it for you without actually evaluating the
> expression.
> The stopping is easy though; if you use a GUI you probably already
> have threads (i.e. when you click on run, it will call the "eval
> prog1" function in a thread, so you can keep editing inside of the
> GUI). You can save the thread id when you run it, and ask to kill it
> when you click on the stop button, and I don't even think it will
> raise an exception.
> If you're not already using threads, I'm curious and would like to
> know how you plan to handle the GUI.
> Regards,
> Martinet Dominique
> PS : O'Reilly's book is a nice place to start if you don't know much
> about threads

Well, I followed the direction on this page, however, whenever I try to
compile using ocamlc, I got "Unbound module Thread" for the line where I
"Thread.create compute ()"

Anyone knows what can be the problem here?

Here is my compiling flags:

world: $(LIBTARGETS) $( src/
    ocamlc $(COMPFLAGS) -thread -custom threads.cma -cclib -lthreads -cclib
-lunix -cclib -lpthread graphics.cma $(LIBTARGETS) $( \
          $( -o acumen src/
    @ echo " -- make world (Done)"

world.opt: $(LIBTARGETSOPT) $(
    ocamlopt -thread threads.cmxa -cclib -lthreads -cclib -lunix -cclib
-lpthread $(COMPFLAGS)  $(LIBTARGETSOPT) $( \
          src/ -ccopt -Wl,-E -o acumen.opt
    @ echo " -- make world.opt (Done)"