From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id 20340BDDB for ; Sat, 3 Sep 2005 09:23:54 +0200 (CEST) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j837NrN2015239 for ; Sat, 3 Sep 2005 09:23:53 +0200 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 JAA20165 for ; Sat, 3 Sep 2005 09:23:53 +0200 (MET DST) Received: from mail.enyo.de (mail.enyo.de [212.9.189.167]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j837L1jM015071 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NO) for ; Sat, 3 Sep 2005 09:23:52 +0200 Received: from deneb.vpn.enyo.de ([212.9.189.177] helo=deneb.enyo.de) by albireo.enyo.de with esmtp id 1EBSKi-0004TP-Ru; Sat, 03 Sep 2005 09:21:00 +0200 Received: from fw by deneb.enyo.de with local (Exim 4.52) id 1EBSKB-0005Xw-7N; Sat, 03 Sep 2005 09:20:27 +0200 From: Florian Weimer To: Bardur Arantsson Cc: caml-list@inria.fr Subject: Re: [Caml-list] Re: Unix.localtime not threadsafe? References: <891bd339050902103460db1a55@mail.gmail.com> Date: Sat, 03 Sep 2005 09:20:27 +0200 In-Reply-To: (Bardur Arantsson's message of "Sat, 03 Sep 2005 09:03:08 +0200") Message-ID: <873bomobwk.fsf@mid.deneb.enyo.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Miltered: at nez-perce with ID 43194F89.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 43194EDD.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; florian:01 caml-list:01 pointer:01 statically:01 struct:01 variants:01 ...:98 unix:01 glibc:01 explicitly:01 allocated:03 solaris:05 problem:05 efficient:06 linux:06 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=none autolearn=disabled version=3.0.3 * Bardur Arantsson: > I don't think the glibc/Linux localtime() man page explicitly states > this, but I expect that it returns a pointer to a *thread-local* > statically allocated struct tm... in which case there's no problem. Thread-local storage is a recent innovation in the Linux camp. Previously, developers seem to think that no efficient implementation was possible. That's why there all the *_r variants (such as localtime_r). I believe Solaris does something in the direction you suggest.