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=0.0 required=5.0 tests=AWL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id A356ABC0C for ; Thu, 25 Jan 2007 15:58:54 +0100 (CET) Received: from ipmail01.adl2.internode.on.net (ipmail01.adl2.internode.on.net [203.16.214.140]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l0PEwq1A016823 for ; Thu, 25 Jan 2007 15:58:53 +0100 Received: from ppp27-234.lns1.syd6.internode.on.net (HELO rosella) ([59.167.27.234]) by ipmail01.adl2.internode.on.net with ESMTP; 26 Jan 2007 01:23:43 +1030 X-IronPort-AV: i="4.13,239,1167571800"; d="scan'208"; a="78703823:sNHT23192372" Subject: Re: [Caml-list] Win32 Services & O'Caml From: skaller To: David Allsopp Cc: OCaml List In-Reply-To: <003501c74077$6785db20$6a7ba8c0@treble> References: <003501c74077$6785db20$6a7ba8c0@treble> Content-Type: text/plain Date: Fri, 26 Jan 2007 01:53:41 +1100 Message-Id: <1169736821.5807.19.camel@rosella.wigram> Mime-Version: 1.0 X-Mailer: Evolution 2.6.1 Content-Transfer-Encoding: 7bit X-Miltered: at discorde with ID 45B8C5AC.001 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; o'caml:01 o'caml:01 ocaml:01 threading:01 threads:01 ocaml:01 pointer:01 threads:01 heap:01 heap:01 sourceforge:01 wrote:01 caml-list:01 natively:01 callback:02 On Thu, 2007-01-25 at 11:53 +0000, David Allsopp wrote: > Yesterday I completed a module that allows construction of Win32 Services in > O'Caml. Non-threaded O'Caml apps seem to be working just fine but I've hit a > brick wall with multi-threaded applications. I'm sure Xavier will fix my misconceptions here, but I suspect the requirement is that Ocaml threading library must start the threads so it can arrange for state to be properly shared, in particular the heap. If other code starts the thread, when it makes a callback into Ocaml, Ocaml can't find the shared state because it was never established. Any system (not just Ocaml) is going to have this problem if it uses an environment not strictly conforming to that provided natively. EG .. how do you share a young heap pointer held in an AMD64 machine register across threads .. when the OS carefully makes sure registers are not shared?? :) -- John Skaller Felix, successor to C++: http://felix.sf.net