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 MAA21231; Fri, 16 Apr 2004 12:19:08 +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 MAA20402 for ; Fri, 16 Apr 2004 12:19:07 +0200 (MET DST) Received: from post.bourget.univ-savoie.fr (post.bourget.univ-savoie.fr [193.48.120.73]) by nez-perce.inria.fr (8.12.10/8.12.10) with ESMTP id i3GAKAjq026972 for ; Fri, 16 Apr 2004 12:20:10 +0200 Received: from univ-savoie.fr (d85.lama.univ-savoie.fr [193.48.123.85]) by post.bourget.univ-savoie.fr (8.12.3/jtpda-5.4) with ESMTP id i3GAMUbM006896 ; Fri, 16 Apr 2004 12:22:30 +0200 Message-ID: <407FB3F5.1060703@univ-savoie.fr> Date: Fri, 16 Apr 2004 12:22:45 +0200 From: Christophe Raffalli User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040115 X-Accept-Language: en-us, en MIME-Version: 1.0 To: caml-list@inria.fr Subject: [Fwd: Re: [Caml-list] Scheduling thread problem kernel 2.6] X-Enigmail-Version: 0.83.3.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig87CBC3CABDAF9A4CD73EFFA8" X-Scanned-By: MIMEDefang 2.33 (www . roaringpenguin . com / mimedefang) X-Miltered: at nez-perce by Joe's j-chkmail ("http://j-chkmail.ensmp.fr")! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; raffalli:01 raffalli:01 univ-savoie:01 caml-list:01 openpgp:01 2440:01 3156:01 preempt:01 posix:01 modif:01 redraw:01 modif:01 bug:01 mainloop:01 lablglut:01 X-Attachments: type="application/pgp-signature" name="signature.asc" name="signature.asc" type="application/pgp-signature" name="signature.asc" name="signature.asc" Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig87CBC3CABDAF9A4CD73EFFA8 Content-Type: multipart/mixed; boundary="------------030307000609090605090106" This is a multi-part message in MIME format. --------------030307000609090605090106 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit 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 --------------------------------------------- --------------030307000609090605090106 Content-Type: application/pgp-signature; name="signature.asc" Content-Transfer-Encoding: base64 Content-Disposition: inline; filename="signature.asc" LS0tLS1CRUdJTiBQR1AgU0lHTkFUVVJFLS0tLS0KVmVyc2lvbjogR251UEcgdjEuMi40IChH TlUvTGludXgpCkNvbW1lbnQ6IFVzaW5nIEdudVBHIHdpdGggTW96aWxsYSAtIGh0dHA6Ly9l bmlnbWFpbC5tb3pkZXYub3JnCgppRDhEQlFGQWY3TzhTUUR5V0IvK3hCd1JBcXMxQUo5WUtU aWVVUFVXcVBPQVQxMC9zZ0pURW5iUWh3Q2ZYdHY0CndjNWJxcGg0MlJtTldVUUlGK3JJVW00 PQo9UFZ4VAotLS0tLUVORCBQR1AgU0lHTkFUVVJFLS0tLS0KCg== --------------030307000609090605090106-- --------------enig87CBC3CABDAF9A4CD73EFFA8 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFAf7P2SQDyWB/+xBwRAj9GAKC+cm1Fk2J0s/E+nRvzryVgcUVHSACfX/Vr 1qg8seP4Uxm4dnGI7aiRNQI= =59Y7 -----END PGP SIGNATURE----- --------------enig87CBC3CABDAF9A4CD73EFFA8-- ------------------- 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