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=0.4 required=5.0 tests=AWL,HTML_FONT_BIG, HTML_FONT_FACE_BAD,HTML_MESSAGE autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id EBD87BC69 for ; Sun, 29 Jul 2007 21:16:10 +0200 (CEST) Received: from xsmtp1.ethz.ch (xsmtp1.ethz.ch [82.130.70.13]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l6TJGA0f009602 for ; Sun, 29 Jul 2007 21:16:10 +0200 Received: from xfe1.d.ethz.ch ([82.130.124.41]) by xsmtp1.ethz.ch with Microsoft SMTPSVC(6.0.3790.3959); Sun, 29 Jul 2007 21:16:10 +0200 Received: from [10.0.1.3] ([80.219.210.76]) by xfe1.d.ethz.ch over TLS secured channel with Microsoft SMTPSVC(6.0.3790.3959); Sun, 29 Jul 2007 21:16:10 +0200 Mime-Version: 1.0 (Apple Message framework v752.3) To: caml-list@yquem.inria.fr Message-Id: <950BC328-B571-4736-A779-8E3EE9CF6F3E@student.ethz.ch> Content-Type: multipart/alternative; boundary=Apple-Mail-1--876545414 From: Kaspar Rohrer Subject: Native multithreaded LablGTK2? Date: Sun, 29 Jul 2007 21:16:08 +0200 X-Mailer: Apple Mail (2.752.3) X-OriginalArrivalTime: 29 Jul 2007 19:16:10.0095 (UTC) FILETIME=[EBD237F0:01C7D214] X-Miltered: at discorde with ID 46ACE77A.001 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; lablgtk:01 ocaml:01 lablgtk:01 lablgl:01 ocaml:01 lib:01 gtkthread:01 cmx:01 lib:01 gtkthread:01 cmx:01 byte:01 lablgl:01 byte:01 compile:01 --Apple-Mail-1--876545414 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed I'm trying to build a multithreaded application (my own, written from scratch) using Ocaml, Lablgtk2, and Lablgl. I use Omake as the build system, and the project consists of several different Ocaml libraries (my own as well as 3rd party). Here's the error I get when I try to compile the application: Files /Users/krohrer/godi/lib/ocaml/pkg-lib/lablgtk2/gtkThread.cmx and /Users/krohrer/godi/lib/ocaml/pkg-lib/lablgtk2/gtkThread.cmx both define a module named GtkThread This only happens when I try to compile a native code application, as opposed to byte code. Now, my knowledge of the ocaml library system is somewhat limited. So I thought I'd ask here, in the hope that if this is really a lablgtk2/ godi/omake error, somebody will tell me. Any ideas on this one? Thanks in advance - Kaspar Rohrer PS: Currently the application is single threaded, but due to output redirection using pipes, I get the occassional freeze. (Pipe gets flooded!) --Apple-Mail-1--876545414 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=US-ASCII
I'm trying to build a multithreaded application = (my own, written from scratch) using Ocaml, Lablgtk2, and Lablgl. I use = Omake as the build system, and the project consists of several different = Ocaml libraries (my own as well as 3rd party).

Here's the error I get = when I try to compile the application:

Files = /Users/krohrer/godi/lib/ocaml/pkg-lib/lablgtk2/gtkThread.cmx
and= = /Users/krohrer/godi/lib/ocaml/pkg-lib/lablgtk2/gtkThread.cmx
bot= h define a module named GtkThread

This only happens when I = try to compile a native code application, as opposed to byte = code.

Now, my knowledge of the ocaml = library system is somewhat limited. So I thought I'd ask here, in the = hope that if this is really a lablgtk2/godi/omake error, somebody will = tell me.
Any ideas on this one?

Thanks in advance
- Kaspar = Rohrer

PS: Currently = the application is single threaded, but due to output redirection using = pipes, I get the occassional freeze. (Pipe gets flooded!)
=
=20 = --Apple-Mail-1--876545414-- 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.4 required=5.0 tests=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 discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id C1E9ABC69 for ; Mon, 30 Jul 2007 07:40:56 +0200 (CEST) Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.189]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l6U5eur2021943 for ; Mon, 30 Jul 2007 07:40:56 +0200 Received: by nf-out-0910.google.com with SMTP id g13so178753nfb for ; Sun, 29 Jul 2007 22:40:56 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:received:date:to:cc:subject:message-id:mail-followup-to:references:mime-version:content-type:content-disposition:in-reply-to:user-agent:from; b=GNK67qSEqtttC0ILeouUj7hLPaaRaG1r4FcH3hfJF18W7GHFcTBfpEl0Xgb+nkyIpZOyNdIcpPY+XXeH+rLNASG5vrNchAuTqVBLp4jILPRiiTeZl3drYVoCEmgklc58IKEMUd4nIhagwNBQzW9dVADlgbRwPaPCPwDDfWBRvu8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:date:to:cc:subject:message-id:mail-followup-to:references:mime-version:content-type:content-disposition:in-reply-to:user-agent:from; b=tpPIeC2nphKyoL2R9JEyxTpPPoDYTS8lyYfXZw3WZCW3yO/9W8Y20kVT3u4O5YCI5STsYpW07ICgt7wH0cgWQ1b/qshuBez3IliJ12dqpt+ZF/Kiqkmwr1fDBf4VAXrnbfI3JS2TMcq/3y70GPIjJtJ1L5q9lctA4G5LTsUAhcs= Received: by 10.86.89.4 with SMTP id m4mr3627375fgb.1185774056132; Sun, 29 Jul 2007 22:40:56 -0700 (PDT) Received: from localhost ( [86.211.2.178]) by mx.google.com with ESMTPS id i5sm12470484mue.2007.07.29.22.40.51 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 29 Jul 2007 22:40:53 -0700 (PDT) Received: by localhost (sSMTP sendmail emulation); Mon, 30 Jul 2007 07:40:48 +0200 Date: Mon, 30 Jul 2007 07:40:48 +0200 To: Kaspar Rohrer Cc: caml-list@inria.fr Subject: Re: [Caml-list] Native multithreaded LablGTK2? Message-ID: <20070730054047.GA11678@jiyu.gnu> Mail-Followup-To: Julien Moutinho , Kaspar Rohrer , caml-list@inria.fr References: <950BC328-B571-4736-A779-8E3EE9CF6F3E@student.ethz.ch> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <950BC328-B571-4736-A779-8E3EE9CF6F3E@student.ethz.ch> User-Agent: Mutt/1.5.16 (2007-06-11) From: Julien Moutinho X-j-chkmail-Score: MSGID : 46AD79E8.001 on discorde : j-chkmail score : X : 0/20 1 0.000 -> 1 X-Miltered: at discorde with ID 46AD79E8.001 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; lablgtk:01 0200,:01 ocaml:01 lablgtk:01 lablgl:01 ocaml:01 lib:01 gtkthread:01 cmx:01 lib:01 gtkthread:01 cmx:01 dependences:01 byte:01 ocamlc:01 On Sun, Jul 29, 2007 at 09:16:08PM +0200, Kaspar Rohrer wrote: > I'm trying to build a multithreaded application (my own, written from > scratch) using Ocaml, Lablgtk2, and Lablgl. I use Omake as the build > system, and the project consists of several different Ocaml libraries (my > own as well as 3rd party). > > Here's the error I get when I try to compile the application: > > Files /Users/krohrer/godi/lib/ocaml/pkg-lib/lablgtk2/gtkThread.cmx > and /Users/krohrer/godi/lib/ocaml/pkg-lib/lablgtk2/gtkThread.cmx > both define a module named GtkThread Sounds like you end up with a doubloon amongst the dependences. > This only happens when I try to compile a native code application, as > opposed to byte code. That's because ocamlc removes doubloons for you, while ocamlopt does not. $ echo "let f () = print_endline \"Namaste\"" > dep.ml $ ocamlc -c dep.ml $ ocamlopt -c dep.ml $ echo "Dep.f ()" > file.ml $ ocamlc -o file dep.cmo dep.cmo file.ml && ./file Namaste $ ocamlopt -o file.opt dep.cmx dep.cmx file.ml && ./file.opt Files dep.cmx and dep.cmx both define a module named Dep > Now, my knowledge of the ocaml library system is somewhat limited. So I > thought I'd ask here, in the hope that if this is really a > lablgtk2/godi/omake error, somebody will tell me. > Any ideas on this one? Check the META.lablgtk2 file: $ ocamlfind query lablgtk2 -format "%A" -predicates native,mt lablgtk.cmxa gtkThread.cmx If you get this, lablgtk2 is not likely to be guilty. For I have never used neither Omake nor Godi, cannot help more. Nonetheless, if I were you I would dive into Omake... > PS: Currently the application is single threaded, but due to output > redirection using pipes, I get the occassional freeze. (Pipe gets flooded!) Weird. 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=0.1 required=5.0 tests=AWL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id F386BBC69 for ; Mon, 30 Jul 2007 10:01:49 +0200 (CEST) Received: from XSMTP0.ethz.ch (xsmtp0.ethz.ch [82.130.70.14]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id l6U81nKP003770 for ; Mon, 30 Jul 2007 10:01:49 +0200 Received: from xfe2.d.ethz.ch ([82.130.124.42]) by XSMTP0.ethz.ch with Microsoft SMTPSVC(6.0.3790.3959); Mon, 30 Jul 2007 10:01:48 +0200 Received: from [10.0.1.3] ([80.219.210.76]) by xfe2.d.ethz.ch over TLS secured channel with Microsoft SMTPSVC(6.0.3790.3959); Mon, 30 Jul 2007 10:01:48 +0200 In-Reply-To: <20070730054047.GA11678@jiyu.gnu> References: <950BC328-B571-4736-A779-8E3EE9CF6F3E@student.ethz.ch> <20070730054047.GA11678@jiyu.gnu> Mime-Version: 1.0 (Apple Message framework v752.3) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <93DE46B0-285F-4066-A1CA-0A3969C728B3@student.ethz.ch> Cc: caml-list@yquem.inria.fr Content-Transfer-Encoding: 7bit From: Kaspar Rohrer Subject: Re: [Caml-list] Native multithreaded LablGTK2? Date: Mon, 30 Jul 2007 10:01:47 +0200 To: Julien Moutinho X-Mailer: Apple Mail (2.752.3) X-OriginalArrivalTime: 30 Jul 2007 08:01:48.0528 (UTC) FILETIME=[E142CF00:01C7D27F] X-Miltered: at concorde with ID 46AD9AED.001 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; lablgtk:01 lablgtk:01 ocamlfind:01 -predicates:01 cmxa:01 gtkthread:01 cmx:01 ocamlfind:01 -predicates:01 cmxa:01 gtkinit:01 cmx:01 gtkthread:01 buffer:01 stdout:01 On 30.07.2007, at 07:40, Julien Moutinho wrote: > Check the META.lablgtk2 file: > $ ocamlfind query lablgtk2 -format "%A" -predicates native,mt > lablgtk.cmxa gtkThread.cmx > > If you get this, lablgtk2 is not likely to be guilty. Here's what I get, so I suppose lablgtk2 is not guilty: > ocamlfind query lablgtk2 -format "%A" -predicates native,mt lablgtk.cmxa lablglade.cmxa lablgnomecanvas.cmxa lablgnomeui.cmxa lablpanel.cmxa gtkInit.cmx gtkThread.cmx > > For I have never used neither Omake nor Godi, cannot help more. > Nonetheless, if I were you I would dive into Omake... Hm, maybe the error is in how I use Omake. I'll look into. >> PS: Currently the application is single threaded, but due to output >> redirection using pipes, I get the occassional freeze. (Pipe gets >> flooded!) > Weird. No, not at all. The redirection happens in the same thread, so if the pipe buffer is full, all write operations will block. And because the application is single threaded, the reader never gets a chance to empty the pipe. Thus, freeze. I'm piping stdout, because that's the only way I was able to redirect stdout to a gtk text widget (using a GIOchannel: GMain.Io.*). If anybody has a better idea, I'd be glad to hear it. I was originally thinking of an out_channel that writes to a buffer instead of a file, but the Ocaml standard library seems to be missing this functionality. Or is it? Anyway, thanks a lot for your help. I appreciate it. 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=0.1 required=5.0 tests=AWL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id C28DCBC69 for ; Mon, 30 Jul 2007 10:22:20 +0200 (CEST) Received: from XSMTP0.ethz.ch (xsmtp0.ethz.ch [82.130.70.14]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id l6U8MIHG010807 for ; Mon, 30 Jul 2007 10:22:20 +0200 Received: from xfe2.d.ethz.ch ([82.130.124.42]) by XSMTP0.ethz.ch with Microsoft SMTPSVC(6.0.3790.3959); Mon, 30 Jul 2007 10:22:18 +0200 Received: from [10.0.1.3] ([80.219.210.76]) by xfe2.d.ethz.ch over TLS secured channel with Microsoft SMTPSVC(6.0.3790.3959); Mon, 30 Jul 2007 10:22:17 +0200 In-Reply-To: <20070730054047.GA11678@jiyu.gnu> References: <950BC328-B571-4736-A779-8E3EE9CF6F3E@student.ethz.ch> <20070730054047.GA11678@jiyu.gnu> Mime-Version: 1.0 (Apple Message framework v752.3) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: Cc: caml-list@yquem.inria.fr Content-Transfer-Encoding: 7bit From: Kaspar Rohrer Subject: Re: [Caml-list] Native multithreaded LablGTK2? Date: Mon, 30 Jul 2007 10:22:17 +0200 To: Julien Moutinho X-Mailer: Apple Mail (2.752.3) X-OriginalArrivalTime: 30 Jul 2007 08:22:17.0700 (UTC) FILETIME=[BDE79240:01C7D282] X-Miltered: at concorde with ID 46AD9FBA.001 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; lablgtk:01 lablgtk:01 ocamlfind:01 -predicates:01 cmxa:01 gtkthread:01 cmx:01 lablgl:01 ocamlfind:01 -predicates:01 lablgl:01 cmxa:01 gtkinit:01 cmx:01 gtkthread:01 On 30.07.2007, at 07:40, Julien Moutinho wrote: > Check the META.lablgtk2 file: > $ ocamlfind query lablgtk2 -format "%A" -predicates native,mt > lablgtk.cmxa gtkThread.cmx > > If you get this, lablgtk2 is not likely to be guilty. Ok, I rechecked this: I think the lablgtk2 META file is the culprit: I'm using OpenGL. So if I add the lablGL predicate, I effectively get this: $ ocamlfind query lablgtk2 -format "%A" -predicates native,mt,lablGL lablgtk.cmxa lablgtkgl.cmxa lablglade.cmxa lablgnomecanvas.cmxa lablgnomeui.cmxa lablpanel.cmxa gtkInit.cmx gtkThread.cmx gtkThread.cmx Which explains the error. But how would I fix this? $ more META description = "Bindings for gtk2" requires="" requires(lablGL)="lablGL" version="20051028" archive(byte)="lablgtk.cma lablglade.cma lablgnomecanvas.cma lablgnomeui.cma lablpanel.cma gtkInit. cmo" archive(native)="lablgtk.cmxa lablglade.cmxa lablgnomecanvas.cmxa lablgnomeui.cmxa lablpanel.cmxa g tkInit.cmx" archive(byte,lablGL)="lablgtk.cma lablgtkgl.cma lablglade.cma lablgnomecanvas.cma lablgnomeui.cma l ablpanel.cma gtkInit.cmo" archive(native,lablGL)="lablgtk.cmxa lablgtkgl.cmxa lablglade.cmxa lablgnomecanvas.cmxa lablgnomeui .cmxa lablpanel.cmxa gtkInit.cmx" archive(byte,mt) += "gtkThread.cmo" archive(native,mt) += "gtkThread.cmx" archive(byte,lablGL,mt) += "gtkThread.cmo" archive(native,lablGL,mt) += "gtkThread.cmx" archive(toploop,mt) += "gtkThInit.cmo" 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.0 required=5.0 tests=AWL,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 concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 53EA1BC69 for ; Mon, 30 Jul 2007 12:01:44 +0200 (CEST) Received: from hu-out-0506.google.com (hu-out-0506.google.com [72.14.214.233]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id l6UA1hJv012577 for ; Mon, 30 Jul 2007 12:01:44 +0200 Received: by hu-out-0506.google.com with SMTP id 16so951195hue for ; Mon, 30 Jul 2007 03:01:43 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:received:date:to:cc:subject:message-id:mail-followup-to:references:mime-version:content-type:content-disposition:in-reply-to:user-agent:from; b=ajXYR7m5xF7mfwq0exVgyCgmw/oIZePaOU6vLREwD4oIk4P9GyHYqv9qoDII5yUNPpqQ1HRIHQZYLSEDrPgI9WEufmFokcyujjTtUULDjFssaie73sNSTn1xL/SiXM5N0FThMXLj5AG9qCHMPwYKwkvJEDxmo2i+G+uzfyMOKGQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:date:to:cc:subject:message-id:mail-followup-to:references:mime-version:content-type:content-disposition:in-reply-to:user-agent:from; b=dm78WmrmnguN72s2LdzTSJ0QX0RpJWD/2QcAh6GClF070EklQrt86+Vq3Vz1Un4jddZ3X3rW8YGiAdVkgZnE2hDPQ9zBeRAHGgr8+2wecVMO65OQClbfeWwp7t0f93LlUxnEaB12VgoH3P0+KVUBs7Bw2F0ZjWC2GwRBspcRzBY= Received: by 10.86.86.12 with SMTP id j12mr3781879fgb.1185789703462; Mon, 30 Jul 2007 03:01:43 -0700 (PDT) Received: from localhost ( [86.211.2.178]) by mx.google.com with ESMTPS id y6sm13410321mug.2007.07.30.03.01.41 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 30 Jul 2007 03:01:42 -0700 (PDT) Received: by localhost (sSMTP sendmail emulation); Mon, 30 Jul 2007 12:01:38 +0200 Date: Mon, 30 Jul 2007 12:01:38 +0200 To: Kaspar Rohrer Cc: caml-list@inria.fr Subject: Re: [Caml-list] Native multithreaded LablGTK2? Message-ID: <20070730100138.GA28423@jiyu.gnu> Mail-Followup-To: Julien Moutinho , Kaspar Rohrer , caml-list@inria.fr References: <950BC328-B571-4736-A779-8E3EE9CF6F3E@student.ethz.ch> <20070730054047.GA11678@jiyu.gnu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.16 (2007-06-11) From: Julien Moutinho X-j-chkmail-Score: MSGID : 46ADB707.001 on concorde : j-chkmail score : X : 0/20 1 0.000 -> 1 X-Miltered: at concorde with ID 46ADB707.001 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; lablgtk:01 0200,:01 lablgtk:01 ocamlfind:01 -predicates:01 cmxa:01 gtkthread:01 cmx:01 lablgl:01 ocamlfind:01 -predicates:01 lablgl:01 cmxa:01 gtkinit:01 cmx:01 On Mon, Jul 30, 2007 at 10:22:17AM +0200, Kaspar Rohrer wrote: > On 30.07.2007, at 07:40, Julien Moutinho wrote: > >> Check the META.lablgtk2 file: >> $ ocamlfind query lablgtk2 -format "%A" -predicates native,mt >> lablgtk.cmxa gtkThread.cmx >> >> If you get this, lablgtk2 is not likely to be guilty. > Ok, I rechecked this: I think the lablgtk2 META file is the culprit: > I'm using OpenGL. So if I add the lablGL predicate, I effectively get this: > > $ ocamlfind query lablgtk2 -format "%A" -predicates native,mt,lablGL > lablgtk.cmxa lablgtkgl.cmxa lablglade.cmxa lablgnomecanvas.cmxa > lablgnomeui.cmxa lablpanel.cmxa gtkInit.cmx gtkThread.cmx gtkThread.cmx > > Which explains the error. But how would I fix this? Perhaps, you can modify lablgtk2/META, doing this: - archive(byte,mt) += "gtkThread.cmo" - archive(native,mt) += "gtkThread.cmx" + archive(byte,mt,-lablGL) += "gtkThread.cmo" + archive(native,mt,-lablGL) += "gtkThread.cmx" or that: - archive(byte,lablGL,mt) += "gtkThread.cmo" - archive(native,lablGL,mt) += "gtkThread.cmx" at your choice. By the way, here are the METAS in Debian Sid: $ cat `ocamlc -where`/lablgtk2/META version="2.6.0" requires(mt) = "threads" requires(mt,mt_vm) = "threads.vm" requires(mt,mt_posix) = "threads.posix" directory="+lablgtk2" archive(byte) = "lablgtk.cma" archive(native) = "lablgtk.cmxa" archive(byte,mt) += "gtkThread.cmo" archive(native,mt) += "gtkThread.cmx" package "init" ( requires = "lablgtk2" archive(byte) = "gtkInit.cmo" archive(native) = "gtkInit.cmx" ) package "glade" ( requires = "lablgtk2" archive(byte) = "lablglade.cma" archive(native) = "lablglade.cmxa" ) package "gtkspell" ( requires = "lablgtk2" archive(byte) = "lablgtkspell.cma" archive(native) = "lablgtkspell.cmxa" ) $ cat `ocamlc -where`/lablGL/META version="1.00" directory="+lablgl" archive(byte) = "lablgl.cma" archive(native) = "lablgl.cmxa" package "togl" ( requires = "labltk lablgl" archive(byte) = "togl.cma" archive(native) = "togl.cmxa" ) package "glut" ( requires = "lablgl" archive(byte) = "lablglut.cma" archive(native) = "lablglut.cmxa" ) At first sight, they seem less comprehensive, but more accurate... 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=0.1 required=5.0 tests=AWL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id EB982BC6C for ; Mon, 30 Jul 2007 13:31:08 +0200 (CEST) Received: from xsmtp1.ethz.ch (xsmtp1.ethz.ch [82.130.70.13]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id l6UBV8YQ006080 for ; Mon, 30 Jul 2007 13:31:08 +0200 Received: from xfe2.d.ethz.ch ([82.130.124.42]) by xsmtp1.ethz.ch with Microsoft SMTPSVC(6.0.3790.3959); Mon, 30 Jul 2007 13:31:08 +0200 Received: from [10.0.1.3] ([80.219.210.76]) by xfe2.d.ethz.ch over TLS secured channel with Microsoft SMTPSVC(6.0.3790.3959); Mon, 30 Jul 2007 13:31:07 +0200 In-Reply-To: <20070730100138.GA28423@jiyu.gnu> References: <950BC328-B571-4736-A779-8E3EE9CF6F3E@student.ethz.ch> <20070730054047.GA11678@jiyu.gnu> <20070730100138.GA28423@jiyu.gnu> Mime-Version: 1.0 (Apple Message framework v752.3) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <5F08528D-1E70-40FA-A73E-040A719C8075@student.ethz.ch> Cc: caml-list@yquem.inria.fr Content-Transfer-Encoding: 7bit From: Kaspar Rohrer Subject: Re: [Caml-list] Native multithreaded LablGTK2? Date: Mon, 30 Jul 2007 13:31:06 +0200 To: Julien Moutinho X-Mailer: Apple Mail (2.752.3) X-OriginalArrivalTime: 30 Jul 2007 11:31:07.0168 (UTC) FILETIME=[1ECB3200:01C7D29D] X-Miltered: at concorde with ID 46ADCBFC.002 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; lablgtk:01 lablgtk:01 byte:01 gtkthread:01 cmo:01 gtkthread:01 cmx:01 byte:01 cmo:01 cmx:01 lablgl:01 lablgl:01 bug:01 ocaml:01 distros:01 On 30.07.2007, at 12:01, Julien Moutinho wrote: > Perhaps, you can modify lablgtk2/META, > doing this: > - archive(byte,mt) += "gtkThread.cmo" > - archive(native,mt) += "gtkThread.cmx" > + archive(byte,mt,-lablGL) += "gtkThread.cmo" > + archive(native,mt,-lablGL) += "gtkThread.cmx" > or that: > - archive(byte,lablGL,mt) += "gtkThread.cmo" > - archive(native,lablGL,mt) += "gtkThread.cmx" > at your choice. Yeah, I'll try that and see if it works. > By the way, here are the METAS in Debian Sid: > [...] > At first sight, they seem less comprehensive, but more accurate... So that would mean that the lablgtk2 package included in Godi is broken / outdated? Maybe I should file a bug report then. It seems to me that Godi is not used very often anyway, as most of the Ocaml packages seem to be readily available on most Linux distros (I'm on Mac OS X, so I can't check). 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.0 required=5.0 tests=AWL,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 concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id A90F6BC69 for ; Mon, 30 Jul 2007 13:57:32 +0200 (CEST) Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.171]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id l6UBvWxi012470 for ; Mon, 30 Jul 2007 13:57:32 +0200 Received: by ug-out-1314.google.com with SMTP id o2so1038401uge for ; Mon, 30 Jul 2007 04:57:29 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:received:date:to:cc:subject:message-id:mail-followup-to:references:mime-version:content-type:content-disposition:in-reply-to:user-agent:from; b=NrOwC4K6y6kmEOOiaCP9K/p+MQnQKHhITiNtvQNoHDtFUeYp4aMuH+hD1pi+hRkTaMvQ1whAxALYYiXp+nZVWl/x5MAQv0a/+bbP+YdQ2cS0X9xhpFUPathVUIbMQ20H6K3+scqo4NLi8rupP3g+OKFD5P7R2QUMctN8gqJ7pmw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:date:to:cc:subject:message-id:mail-followup-to:references:mime-version:content-type:content-disposition:in-reply-to:user-agent:from; b=o4cPIh1rY9u3Tc4uH/tvZbkAD0AZURJXCt45SJ7HKBKc99fbTo5O7XjT0rWUIAEBFrNDE07nCkKh8L8HHT/IdOFVUK/4t5C91jaujYw0tbUTKxf+eEoiMSIzXxwqcJ2gBPF0z5Osj6PLDsWNQg7h57qGHHLcHwnshWrD7tteefU= Received: by 10.86.81.8 with SMTP id e8mr3862172fgb.1185796649846; Mon, 30 Jul 2007 04:57:29 -0700 (PDT) Received: from localhost ( [86.211.2.178]) by mx.google.com with ESMTPS id 31sm356268fkt.2007.07.30.04.57.27 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 30 Jul 2007 04:57:29 -0700 (PDT) Received: by localhost (sSMTP sendmail emulation); Mon, 30 Jul 2007 13:57:25 +0200 Date: Mon, 30 Jul 2007 13:57:25 +0200 To: Kaspar Rohrer Cc: caml-list@inria.fr Subject: Re: [Caml-list] Native multithreaded LablGTK2? Message-ID: <20070730115725.GB28423@jiyu.gnu> Mail-Followup-To: Julien Moutinho , Kaspar Rohrer , caml-list@inria.fr References: <950BC328-B571-4736-A779-8E3EE9CF6F3E@student.ethz.ch> <20070730054047.GA11678@jiyu.gnu> <93DE46B0-285F-4066-A1CA-0A3969C728B3@student.ethz.ch> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <93DE46B0-285F-4066-A1CA-0A3969C728B3@student.ethz.ch> User-Agent: Mutt/1.5.16 (2007-06-11) From: Julien Moutinho X-j-chkmail-Score: MSGID : 46ADD22C.000 on concorde : j-chkmail score : X : 0/20 1 0.000 -> 1 X-Miltered: at concorde with ID 46ADD22C.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; lablgtk:01 0200,:01 buffer:01 pervasives:01 stdout:01 stdout:01 gtk:01 giochannel:01 gmain:01 buffer:01 ocaml:01 threads:01 wrote:01 caml-list:01 writes:01 On Mon, Jul 30, 2007 at 10:01:47AM +0200, Kaspar Rohrer wrote: >>> PS: Currently the application is single threaded, but due to output >>> redirection using pipes, I get the occassional freeze. (Pipe gets flooded!) >> Weird. > No, not at all. The redirection happens in the same thread, so if the pipe > buffer is full, all write operations will block. And because the > application is single threaded, the reader never gets a chance to empty the > pipe. Thus, freeze. Oki douki, it's just that I did not undertand why you use std(in|out) to communicate between threads... But you use them because you want a buffering machinery and you have only looked at Pervasives, right? > I'm piping stdout, because that's the only way I was able to redirect > stdout to a gtk text widget (using a GIOchannel: GMain.Io.*). If anybody > has a better idea, I'd be glad to hear it. I was originally thinking of an > out_channel that writes to a buffer instead of a file, but the Ocaml > standard library seems to be missing this functionality. Or is it? You have [Stream.t], [Buffer.t] and [GText.buffer] at your service. HTH. 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=0.1 required=5.0 tests=AWL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 0FA13BC69 for ; Mon, 30 Jul 2007 15:22:09 +0200 (CEST) Received: from XSMTP0.ethz.ch (xsmtp0.ethz.ch [82.130.70.14]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id l6UDM6Di004190 for ; Mon, 30 Jul 2007 15:22:08 +0200 Received: from xfe1.d.ethz.ch ([82.130.124.41]) by XSMTP0.ethz.ch with Microsoft SMTPSVC(6.0.3790.3959); Mon, 30 Jul 2007 15:22:06 +0200 Received: from [10.0.1.3] ([80.219.210.76]) by xfe1.d.ethz.ch over TLS secured channel with Microsoft SMTPSVC(6.0.3790.3959); Mon, 30 Jul 2007 15:22:06 +0200 In-Reply-To: <20070730115725.GB28423@jiyu.gnu> References: <950BC328-B571-4736-A779-8E3EE9CF6F3E@student.ethz.ch> <20070730054047.GA11678@jiyu.gnu> <93DE46B0-285F-4066-A1CA-0A3969C728B3@student.ethz.ch> <20070730115725.GB28423@jiyu.gnu> Mime-Version: 1.0 (Apple Message framework v752.3) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <498E26F4-E414-48A1-ADDE-8A6E03486E82@student.ethz.ch> Cc: caml-list@yquem.inria.fr Content-Transfer-Encoding: 7bit From: Kaspar Rohrer Subject: Re: [Caml-list] Native multithreaded LablGTK2? Date: Mon, 30 Jul 2007 15:22:04 +0200 To: Julien Moutinho X-Mailer: Apple Mail (2.752.3) X-OriginalArrivalTime: 30 Jul 2007 13:22:06.0188 (UTC) FILETIME=[9FE102C0:01C7D2AC] X-Miltered: at concorde with ID 46ADE5FE.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; lablgtk:01 pervasives:01 gtk:01 stdout:01 stdout:01 gtk:01 giochannel:01 gmain:01 buffer:01 ocaml:01 buffer:01 gmain:01 iirc:01 threads:01 wrote:01 On 30.07.2007, at 13:57, Julien Moutinho wrote: > Oki douki, it's just that I did not undertand why you use std(in|out) > to communicate between threads... But you use them because you want > a buffering machinery and you have only looked at Pervasives, right? No, the problem is of a different nature: I want to capture standard output and display it in a (log) window in my Gtk application. I'm aware that I could just use custom output functions, but the main problem here is that I've embedded a Scheme interpreter (Ocs, actually: http://will.iki.fi/software/ocs/) which writes to stdout by default. Now, of course I could adapt Ocs to suit my needs. But I have no intention to do so at the moment (although it would be relatively straight forward by extending Ocs_port). >> I'm piping stdout, because that's the only way I was able to redirect >> stdout to a gtk text widget (using a GIOchannel: GMain.Io.*). If >> anybody >> has a better idea, I'd be glad to hear it. I was originally >> thinking of an >> out_channel that writes to a buffer instead of a file, but the Ocaml >> standard library seems to be missing this functionality. Or is it? > You have [Stream.t], [Buffer.t] and [GText.buffer] at your service. > > HTH. I actually already use a GText.buffer. In conjunction with piping and GMain.Io.add_watch, I am able to redirect standard output to the buffer and thus display it in a text widget. But this only works reliably if the application is multithreaded, because pipes have a fixed size buffer (something around 5000 bytes IIRC). Now, if the buffer was able to capture all output, this would work for a single thread also. Because writes to the buffer would never block, unlike writes to a pipe. I might be wrong on all of the above though, as I am far from an expert on either Gtk or multithreading. Anyway, thanks again. I really apreciate any help I can get.