Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] Ocamlex/ocamlyacc breakage?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Jacques Garrigue <garrigue@k...>
Subject: Re: [Caml-list] Ocamlex/ocamlyacc breakage?
From: Stalkern 2 <stalkern2@tin.it>
> 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