From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 0848DBB81 for ; Tue, 14 Feb 2006 03:40:27 +0100 (CET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id k1E2eQA8017439 for ; Tue, 14 Feb 2006 03:40:26 +0100 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 DAA25773 for ; Tue, 14 Feb 2006 03:40:26 +0100 (MET) Received: from wproxy.gmail.com (wproxy.gmail.com [64.233.184.204]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id k1E2ePK7025440 for ; Tue, 14 Feb 2006 03:40:25 +0100 Received: by wproxy.gmail.com with SMTP id i24so985644wra for ; Mon, 13 Feb 2006 18:40:25 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=kvDR4xdMaaiYLyMQ/ZZKwNFlFYVO/gOb7LlXeEu8upZlTMN99OO5eDQ703CbXwY11XQCCt6z3nM0Ektozqdd+wsaDqPv5De/UZxcSlKSG+4LlmIh4vhLtwMrWsNT+jMjtqOZF/YhoT0kdQVQ4Prw+7t2vVTPa1+Kh5mJSfTX134= Received: by 10.65.254.19 with SMTP id g19mr854904qbs; Mon, 13 Feb 2006 18:40:20 -0800 (PST) Received: by 10.65.35.3 with HTTP; Mon, 13 Feb 2006 18:40:20 -0800 (PST) Message-ID: Date: Tue, 14 Feb 2006 15:40:20 +1300 From: Jonathan Roewen Subject: Re: [Caml-list] Re: Thread Local Storage Cc: caml-list@inria.fr In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: X-Miltered: at concorde with ID 43F1431A.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 43F14319.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 hashtable:01 argv:01 descriptors:01 stdin:01 stdout:01 stderr:01 stdin:01 stdout:01 stderr:01 compiler:01 runtime:01 interfaces:01 interfaces:01 functions:01 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_BY_IP autolearn=disabled version=3.0.3 > I don't know if there are better solutions but at least you can use an > hashtable or a balanced tree or whatever (protected by a mutex) indexed o= n > thread identifiers as reported by "Thread.id (Thread.self ())" or > something similar. Yes, but that means that you need functions to lookup the values, rather than having the value have process-dependent values globally. Think like Sys.argv (etc) -- this'd require changes to the interfaces (not such a big deal, since I have control over all interfaces). But to go even further, having distinct descriptors for stdin/stdout/stderr, then you could see where this would become unstuck. Whilst I have code that can change the value transparently for stdin/stdout/stderr, this'd make for a bigger process switch if I had to do for all TLS values. Perhaps what I need would require a change to the compiler and runtime =3D/ What I'd also want to avoid, but I guess I'll have to face the music.... Jonathan