From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id CAA31909; Wed, 9 Apr 2003 02:16:24 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id CAA31897 for ; Wed, 9 Apr 2003 02:16:23 +0200 (MET DST) Received: from kurims.kurims.kyoto-u.ac.jp (kurims.kurims.kyoto-u.ac.jp [130.54.16.1]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id h390GL909066 for ; Wed, 9 Apr 2003 02:16:22 +0200 (MET DST) Received: from localhost (suiren.kurims.kyoto-u.ac.jp [130.54.16.25]) by kurims.kurims.kyoto-u.ac.jp (8.9.3p2/3.7W) with ESMTP id JAA11448; Wed, 9 Apr 2003 09:16:15 +0900 (JST) To: stalkern2@tin.it Cc: caml-list@inria.fr Subject: Re: [Caml-list] Ocamlex/ocamlyacc breakage? In-Reply-To: <200304090120.56363.stalkern2@tin.it> References: <200304081808.48574.stalkern2@tin.it> <20030408180339.B73157F4D@lobus.fungible.com> <200304090120.56363.stalkern2@tin.it> X-Mailer: Mew version 1.94.2 on Emacs 21.2 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-Id: <20030409091624G.garrigue@kurims.kyoto-u.ac.jp> Date: Wed, 09 Apr 2003 09:16:24 +0900 From: Jacques Garrigue X-Dispatcher: imput version 20000228(IM140) X-Spam: no; 0.00; jacques:01 caml-list:01 stalkern:01 stdout:01 fork:01 threads:01 blocking:01 gtk:01 command:98 garrigue:01 unix:02 thread:02 computations:03 bunch:03 ocamlyacc:05 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk From: Stalkern 2 > If I just start a bunch of readers, > GTK and stdout freeze; > if I have Unix.fork parents wait for Unix.fork reading children, > readers show that they can't read everything to the end but stop at random > points, > and only GTK drawing areas connected to expose events freeze. IIRC, you must be careful when using Unix.fork in a gtk program, because the child thread will attempt to close the X connection on exit, except if you use exec to start another command. The natural way to do it is indeed to start independent threads for readers. Glib.Io.add_watch is another option, if you just intend to wait for input without blocking computations. Jacques Garrigue ------------------- 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