Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Oliver Bandel <oliver@first.in-berlin.de>
To: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] Why 'Graphics.wait_next_event' doesn't reply anymore ?
Date: Mon, 12 Nov 2007 22:18:34 +0100	[thread overview]
Message-ID: <1194902314.4738c32a070fd@webmail.in-berlin.de> (raw)
In-Reply-To: <20071112205411.0d2d6dfc@localhost.localdomain>

Hi Fabrice,

Zitat von Fabrice Marchant <fabrice.marchant@orange.fr>:
[...]
>   In fact the true application where the problem originally raised is :
> http://fabrice.marchant.free.fr/funLife/
[...]

I only have looked some minutes into the code.
fast browsed ;-)

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!


Ciao,
   Oliver


P.S.: The Mutex must be in the environment of both threads,
      so must be defined at the toplevel of the autoPlay.ml,
      which means unit-global, as "running" also is.


  reply	other threads:[~2007-11-12 21:18 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-10 22:01 Fabrice Marchant
2007-11-11 14:07 ` [Caml-list] " Fabrice Marchant
2007-11-11 16:48   ` Oliver Bandel
2007-11-11 18:35     ` Julien Moutinho
2007-11-11 20:13       ` Fabrice Marchant
2007-11-12  0:33       ` Oliver Bandel
2007-11-11 19:40     ` Fabrice Marchant
2007-11-12  0:43       ` Oliver Bandel
2007-11-12 19:54         ` Fabrice Marchant
2007-11-12 21:18           ` Oliver Bandel [this message]
2007-11-13  7:45             ` Fabrice Marchant
2007-11-13 10:14               ` Oliver Bandel
2007-11-13 20:10                 ` Fabrice Marchant
2007-11-14  0:33                   ` Oliver Bandel
2007-11-12  0:46       ` Oliver Bandel
2007-11-12  6:18       ` Oliver Bandel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1194902314.4738c32a070fd@webmail.in-berlin.de \
    --to=oliver@first.in-berlin.de \
    --cc=caml-list@yquem.inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox