From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: * X-Spam-Status: No, score=1.5 required=5.0 tests=AWL,HTML_MESSAGE, MAILTO_TO_SPAM_ADDR,SPF_NEUTRAL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by yquem.inria.fr (Postfix) with ESMTP id 26299BBC1 for ; Sun, 17 Feb 2008 23:03:09 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAGs9uEfRVZK2kmdsb2JhbACCPDWNZAEBAQEHBAQJChaBFpM7hGs X-IronPort-AV: E=Sophos;i="4.25,367,1199660400"; d="scan'208";a="9284690" Received: from concorde.inria.fr ([192.93.2.39]) by mail3-smtp-sop.national.inria.fr with ESMTP; 17 Feb 2008 23:03:08 +0100 Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id m1HM38hG031396 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Sun, 17 Feb 2008 23:03:08 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAGs9uEfRVZK2kmdsb2JhbACCPDWNZAEBAQEHBAQJChaBFpM7hGs X-IronPort-AV: E=Sophos;i="4.25,367,1199660400"; d="scan'208";a="9284689" Received: from wa-out-1112.google.com ([209.85.146.182]) by mail3-smtp-sop.national.inria.fr with ESMTP; 17 Feb 2008 23:03:05 +0100 Received: by wa-out-1112.google.com with SMTP id m34so2684643wag.9 for ; Sun, 17 Feb 2008 14:03:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; bh=7er1E0q83ScH24SDD0kXJYhpT8et9Pq4R9ruZsoe99g=; b=g3ARMOsCh7paaLu5PHKEI/38WRzHLR7POyuFqfAglb4aKg01TNRd8cxnFaAwgk60ANJykEYtvVxBIWDQQNhqnFTuPn1Ecc5R5WSkBFaB5kFjZPZZS2C0ywFW8z3vdJoww5T7+nurNppL8DmapYX5A69UF+4QLRC+RhhtFBhyVyw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=UZsf/pnxZIPf+qOCJCiAPzLzSFEbwH0LpEZOT8B2JPA/zuow4t1KxlxVtd8iKboRQ97ZwwkUlMNpIxAYacSOM6/b1kNy1JcAP4KMYE6lZ8000xJmTlJm299YiXeFF+h0opJNt/18DHRg19OPhCh9iKNgB3d69dGGrPKdE++Vg4M= Received: by 10.114.124.1 with SMTP id w1mr58097wac.131.1203285784883; Sun, 17 Feb 2008 14:03:04 -0800 (PST) Received: by 10.114.182.17 with HTTP; Sun, 17 Feb 2008 14:03:04 -0800 (PST) Message-ID: Date: Sun, 17 Feb 2008 16:03:04 -0600 From: "Angela Zhu" To: "Dominique Martinet" Subject: Re: [Caml-list] Cancel button or Status bar Cc: caml-list@inria.fr In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_12646_11634056.1203285784880" References: X-Miltered: at concorde with ID 47B8AF1C.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; martinet:01 ocaml:01 martinet:01 o'reilly's:01 oreilly-book:01 ocamlc:01 flags:01 cmo:01 ocamlc:01 compflags:01 -thread:01 -custom:01 -cclib:01 -cclib:01 -lunix:01 ------=_Part_12646_11634056.1203285784880 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline 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 > http://caml.inria.fr/pub/docs/oreilly-book/html/book-ora175.html > 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 have: "Thread.create compute ()" Anyone knows what can be the problem here? Here is my compiling flags: world: $(LIBTARGETS) $(GTKSRCFILES:.ml=.cmo) src/main.ml ocamlc $(COMPFLAGS) -thread -custom threads.cma -cclib -lthreads -cclib -lunix -cclib -lpthread graphics.cma $(LIBTARGETS) $(GTKSRCFILES:.ml=.cmo) \ $(TKSRCFILES:.ml=.cmo) -o acumen src/main.ml @ echo " -- make world (Done)" world.opt: $(LIBTARGETSOPT) $(GTKSRCFILES:.ml=.cmx) ocamlopt -thread threads.cmxa -cclib -lthreads -cclib -lunix -cclib -lpthread $(COMPFLAGS) $(LIBTARGETSOPT) $(GTKSRCFILES:.ml=.cmx) \ src/main.ml -ccopt -Wl,-E -o acumen.opt @ echo " -- make world.opt (Done)" Best, Angela ------=_Part_12646_11634056.1203285784880 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline

On Feb 16, 2008 11:26 AM, Dominique Martinet <asmadeus77@gmail.com> 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 http://caml.inria.fr/pub/docs/oreilly-book/html/book-ora175.html

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 have:
"Thread.create compute ()"

Anyone knows what can be the problem here?

Here is my compiling flags:

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

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


Best,
Angela

------=_Part_12646_11634056.1203285784880--