Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:85695 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 7888 invoked from network); 2 Apr 2015 19:24:48 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 2 Apr 2015 19:24:48 -0000 Authentication-Results: pb1.pair.com smtp.mail=danack@basereality.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=danack@basereality.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain basereality.com from 209.85.217.172 cause and error) X-PHP-List-Original-Sender: danack@basereality.com X-Host-Fingerprint: 209.85.217.172 mail-lb0-f172.google.com Received: from [209.85.217.172] ([209.85.217.172:35820] helo=mail-lb0-f172.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 01/08-56257-D779D155 for ; Thu, 02 Apr 2015 14:24:46 -0500 Received: by lbdc10 with SMTP id c10so66220393lbd.2 for ; Thu, 02 Apr 2015 12:24:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=f3ChkSrlJt3HDW+Bj3cpNd1xBUsNTt5nJh/THuVIn60=; b=fCXtRPZr0GNhAT9tuZq0M/oqzyxuW92Yx06WmVWgSsja8yf9oQjv9KCmLC3qjtLJ5u mzzm/h9oVGyT6pjcCTf3aK6DY+gJiquFP8ijaozVX5C7YwaPjQkLb1J3Lymrpi0hNCZx t0BINBOwe9BgItiSKx4qnDpNLkTHftREnOv6Y7ueTjUEbBkSu1+Yc8JNnJ9+c2JYaEnx W7LYGY5Qsw8jvv/KDN4ignuqJUNwv2iU8Ama6NceL7RpksqiIWimjI3LNol/86zonqsy m+qd/nIgLkxKR7wgoTdGXNfe62KMPEPhFBFkLrHEsjMsAi8NZTK6cQTtmNcklfIbOrYd 8TjQ== X-Gm-Message-State: ALoCoQmddtUGL0pGjBgGzryhf08VC4Z7YsGM3eLa36JkXKffyDJOkN1do+Wg9ztGyZURFu+v+IAZ MIME-Version: 1.0 X-Received: by 10.152.28.5 with SMTP id x5mr41375228lag.112.1428002682908; Thu, 02 Apr 2015 12:24:42 -0700 (PDT) Received: by 10.25.87.202 with HTTP; Thu, 2 Apr 2015 12:24:42 -0700 (PDT) X-Originating-IP: [78.144.121.114] In-Reply-To: References: <551CEDF6.7090408@lerdorf.com> Date: Thu, 2 Apr 2015 19:24:42 +0000 Message-ID: To: Keyur Govande Cc: Rasmus Lerdorf , "internals@lists.php.net" Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] Deprecate setlocale? From: danack@basereality.com (Dan Ackroyd) On 2 April 2015 at 16:01, Keyur Govande wrote: > > > To Rasmus's point, here's a PR for HHVM to provide a thread-safe setlocale > implementation: https://github.com/facebook/hhvm/pull/4736/files > > It should be fairly easy to refactor the thread-safe-setlocale.(h/cpp) files > for Zend. Ok, that' pretty awesome. So assumming that we incorporated that new thread safe version of locale, how would we expose it? Most people who are calling setlocale are unaware of it's side effects, and so should be using the new safe version by default. Some people who are calling setlocale will actually be using the cross-thread behaviour and so that still needs to work. setlocale is a variadic function, so it's not possible to hack in a flag parameter. As much as I dislike ini settings, it seems like adding one here would be sensible e.g. 'thread_safe_setlocale' * If it's enabled the setlocale function calls the new thread safe functionality. * If it's disabled the setlocale function calls the current non-TS C setlocale function. Does anyone have a better suggestion on exposing a thread safe version? cheers Dan