caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Fwd: Re: [Caml-list] Scheduling thread problem kernel 2.6]
@ 2004-04-16 10:22 Christophe Raffalli
  2004-04-21 14:57 ` Christophe Raffalli
  0 siblings, 1 reply; 2+ messages in thread
From: Christophe Raffalli @ 2004-04-16 10:22 UTC (permalink / raw)
  To: caml-list


[-- Attachment #1.1: Type: text/plain, Size: 1594 bytes --]



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
---------------------------------------------


[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 253 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 252 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Fwd: Re: [Caml-list] Scheduling thread problem kernel 2.6]
  2004-04-16 10:22 [Fwd: Re: [Caml-list] Scheduling thread problem kernel 2.6] Christophe Raffalli
@ 2004-04-21 14:57 ` Christophe Raffalli
  0 siblings, 0 replies; 2+ messages in thread
From: Christophe Raffalli @ 2004-04-21 14:57 UTC (permalink / raw)
  To: Christophe Raffalli; +Cc: caml-list

[-- Attachment #1: Type: text/plain, Size: 1142 bytes --]

Christophe Raffalli wrote:
> 
> 
> 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 ;-).
> 

In fact, I did not test GlSurf competing with another CPU intensive 
Thread. In this case, on a kernel 2.6, it is necessary to do 
modification A for GlSurf to get some CPU.

What it the rôle of the tick_thread with posix_thread ?

-- 
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
---------------------------------------------

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 252 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-04-21 14:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-04-16 10:22 [Fwd: Re: [Caml-list] Scheduling thread problem kernel 2.6] Christophe Raffalli
2004-04-21 14:57 ` Christophe Raffalli

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).