Here is the final picture: I invistigated the following modifications: A) let preempt = () instead of Thread.yield () in thread_posix.ml (modif de OCaml) B) adding proper enter/leaving_blocking_section in glut (file wrap_glut.c) C) using a timer instead of an idle function for the interactive thread (I need to redraw the surface when it is moving and I do it event when it is not moving ;-). Here are the time mesurments (+X means with modif X, -X means without modif X): +A+B+C : ~43s +A-B+C : loop (never a chance to change thread) -A+B+C : ~43s -A-B+C : ~89s -A+B-C : ~85s So the real problem were - a bug in glut (enter_blocking_section was really usefull before entering the mainLoop !!) - it is a bad idea to use an Idlefunc with lablGlut if another thread needs some CPU. Better say I want 20 frames per seconds => I use a times every 50ms. - The periodic calls to yield from OCaml are not bad they allow a little scheduling and did a partial fix of the lablGlut bug, but still this was not enough to really "fix the bug" (see -A-B+C). But, may be I would have prefer to discover the bug sooner ... See my next post ... -- Christophe Raffalli Université de Savoie Batiment Le Chablais, bureau 21 73376 Le Bourget-du-Lac Cedex tél: (33) 4 79 75 81 03 fax: (33) 4 79 75 87 42 mail: Christophe.Raffalli@univ-savoie.fr www: http://www.lama.univ-savoie.fr/~RAFFALLI --------------------------------------------- IMPORTANT: this mail is signed using PGP/MIME At least Enigmail/Mozilla, mutt or evolution can check this signature ---------------------------------------------