English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
Why 'Graphics.wait_next_event' doesn't reply anymore ?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2007-11-13 (08:43)
From: Fabrice Marchant <fabrice.marchant@o...>
Subject: Re: [Caml-list] Why 'Graphics.wait_next_event' doesn't reply anymore ?
> Both threads use the Graphics-module (via View-module).
> Possibly the problem is, that the access
> is not protected: use Mutexes, when calling the View.<function>,
> so that each Thread only has access to the View-functions
> (and the Graphics module's functions), when the other thread
> is ready with it's work. Otherwise possibly things become confused.
> So, wrap each of the View.<function> calls with
> calls to Mutex.lock and Mutex.unlock.
> Possibly this is your main problem!

  Great ! Oliver, it was this. All perfectly rocks at full speed now.
I'm very happy my Game of Life finally works.
However, I've not understood why this Mutex was needed : what could be
the data shared with 'wait_next_event' ?
  Some internal of Graphics module ?