Sender: lebotlan at beaune.inria.fr Message-ID: <3CD2B6B1.5F548013 at beaune.inria.fr> Date: Fri, 03 May 2002 18:11:29 +0200 From: Didier Le Botlan Organization: INRIA (Projet CRISTAL) MIME-Version: 1.0 To: Jacques Garrigue Cc: lablgtk at kaba.or.jp Subject: Re: Build and thread problem. References: <3CC961AF.2076EFF2 at beaune.inria.fr> <20020427000319V.garrigue at kurims.kyoto-u.ac.jp> Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Jacques Garrigue a écrit : > If you create a thread in a callback, it will have to wait until the > next iteration of GTK's main loop before starting. You can see how it > work in works ing src/gtkThread.ml. Normally it should be almost > immediate, but note that if there are lots of pending events, threads > are only checked every 100 iterations. Still I cannot see how it can > take up to 30 seconds! > > By the way, do you use bytecode threads of pthreads? > I have done virtually no testing with bytecode threads. I used bytecode threads, and while it worked perfectly in a short test-program, a new-born thread takes more than 30 seconds to start. Then, I compiled ocaml with -with-pthreads. My test program works perfectly (bytecode and native). Under lablgtk, the bytecode version works poorly : It is slower than it should be. When I click another button (which does nothing : its handler is fun () -> ()), the thread runs a little bit faster, then slowlier until the next click. Here is what I observe with the native version : When I launch a new thread, nothing happens (it can last for 30 seconds, perhaps more). As soon as I click another button (again a useless button), the thread is launched and runs for a short time, then stops until I click again on the same useless-button. > Also, you may try the camlirc application in lablgtk-2002025, since it > uses threads, seemingly without problems. I tried it a little but could not use it properly (I am not used to IRC, and did not know exactly how to make it work...I end with segfaults or 'config error').