From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id SAA28175 for caml-redistribution; Tue, 16 Mar 1999 18:27:37 +0100 (MET) 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 SAA18692 for ; Tue, 16 Mar 1999 18:20:26 +0100 (MET) Received: from fiji01.liquidmarket.com ([208.244.147.130]) by nez-perce.inria.fr (8.8.7/8.8.7) with ESMTP id SAA05070 for ; Tue, 16 Mar 1999 18:20:23 +0100 (MET) Received: from maui02.liquidmarket.com (maui02.liquidmarket.com [192.168.1.65]) by fiji01.liquidmarket.com (8.8.7/8.8.7) with ESMTP id JAA04021; Tue, 16 Mar 1999 09:15:51 -0800 Message-Id: <199903161715.JAA04021@fiji01.liquidmarket.com> X-Mailer: exmh version 2.0.2 From: Francois Rouaix To: Don Syme cc: caml-list@inria.fr Subject: Re: threads & OCamlTK In-reply-to: Your message of "Mon, 15 Mar 1999 07:05:21 PST." <39ADCF833E74D111A2D700805F1951EF0F00BA6B@RED-MSG-06> Reply-To: frouaix@liquidmarket.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Tue, 16 Mar 1999 09:18:01 -0800 Sender: weis > And, on a vaguely related topic, is it possible to use threads with programs > that also use OCamlTK? I know Tk is not threadsafe, but if only one thread > is calling Tk functions, then perhaps it's still OK? Yes, it should be ok. But this also includes the Tk event loop, and thus all callbacks. Also, there is the issue of using Thread primitives within a callback (e.g. having the callback on a button triggering a condition). In bytecode threads, this will probably not work. Jun and I discussed these issues a long time ago, and Jun implemented a modified version of the CamlTK core where the event loop would be handled in Caml instead of C, so as to be compatible with threads, to some extent (all other Tk calls still need to be in a critical section). I don't think we ever distributed this version, and I'm not even sure it would work on Windows, but you might want to check with Jun. --f