From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: * X-Spam-Status: No, score=1.4 required=5.0 tests=AWL,DNS_FROM_RFC_ABUSE, DNS_FROM_RFC_POST autolearn=disabled version=3.1.3 Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by yquem.inria.fr (Postfix) with ESMTP id 25CA2BC69 for ; Tue, 13 Nov 2007 09:43:50 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAPbyOEdQDPIalmdsb2JhbACBW40tAQEBAQcEBiIH X-IronPort-AV: E=Sophos;i="4.21,409,1188770400"; d="scan'208";a="4364747" Received: from smtp20.orange.fr ([80.12.242.26]) by mail1-smtp-roc.national.inria.fr with ESMTP; 13 Nov 2007 09:43:50 +0100 Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf2004.orange.fr (SMTP Server) with ESMTP id AF2A61C0009C for ; Tue, 13 Nov 2007 09:43:49 +0100 (CET) Received: from localhost.localdomain (Mix-Lyon-303-1-151.w193-248.abo.wanadoo.fr [193.248.43.151]) by mwinf2004.orange.fr (SMTP Server) with ESMTP id C1C381C00097 for ; Tue, 13 Nov 2007 09:43:48 +0100 (CET) X-ME-UUID: 20071113084348793.C1C381C00097@mwinf2004.orange.fr Date: Tue, 13 Nov 2007 08:45:47 +0100 From: Fabrice Marchant To: caml-list@yquem.inria.fr Subject: Re: [Caml-list] Why 'Graphics.wait_next_event' doesn't reply anymore ? Message-ID: <20071113084547.2214223f@localhost.localdomain> In-Reply-To: <1194902314.4738c32a070fd@webmail.in-berlin.de> References: <20071110230145.3aebafe4@localhost.localdomain> <20071111150720.4f8d1c44@localhost.localdomain> <1194799714.473732620f33e@webmail.in-berlin.de> <20071111204019.4697d387@localhost.localdomain> <1194828182.4737a196e3582@webmail.in-berlin.de> <20071112205411.0d2d6dfc@localhost.localdomain> <1194902314.4738c32a070fd@webmail.in-berlin.de> X-Mailer: Claws Mail 2.10.0 (GTK+ 2.10.13; i486-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam: no; 0.00; mutexes:01 module's:01 threads:01 oliver:01 caml-list:01 functions:01 data:02 graphics:02 graphics:02 module:03 mutex:03 mutex:03 confused:04 problem:05 problem:05 > 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., > 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. 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 ? Regards, Fabrice