Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:85697 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 12507 invoked from network); 2 Apr 2015 19:56:01 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 2 Apr 2015 19:56:01 -0000 Authentication-Results: pb1.pair.com header.from=derokorian@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=derokorian@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.42 as permitted sender) X-PHP-List-Original-Sender: derokorian@gmail.com X-Host-Fingerprint: 74.125.82.42 mail-wg0-f42.google.com Received: from [74.125.82.42] ([74.125.82.42:33173] helo=mail-wg0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 49/D8-56257-FCE9D155 for ; Thu, 02 Apr 2015 14:56:00 -0500 Received: by wgin8 with SMTP id n8so5974121wgi.0 for ; Thu, 02 Apr 2015 12:55:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=HBg68RBOpVcQaKoA2Wf5ZPfq3KJSPF6pfr/phxcMUMk=; b=nGirMo39adVjruUjdrwszd9A18pBiJ2FMjxhEOy6lVdt7bcgQPLsPtBGm1Ybm6fhMI 08WJvj7lNjjc4juMiQozbm/Q/08/ylsNFF5aCXuZluVj7I0KowOnk8TyFPyxdzfFTpbH 06hMlKCYbrADW0m/Je0IENPaS03derpMUkITcx51UaHGM39RiqfwePxw6wgSSsr8O0Wn tTc88q55axtdOV8c/Mh5qPP735EOPt1ErDay9pZzTOWKHoOqNXBB3Gk5XFqocQLYHsgR fKx/hJQQCwZPkRtNF0+ZVfulNgq7y4+PuSiBE0cH7wbR+zzEOx5r+fD/6EIJzUOwbRGr Zcfw== MIME-Version: 1.0 X-Received: by 10.194.157.39 with SMTP id wj7mr97556471wjb.57.1428004556909; Thu, 02 Apr 2015 12:55:56 -0700 (PDT) Received: by 10.27.14.2 with HTTP; Thu, 2 Apr 2015 12:55:56 -0700 (PDT) In-Reply-To: References: <551CEDF6.7090408@lerdorf.com> Date: Thu, 2 Apr 2015 13:55:56 -0600 Message-ID: To: Adam Harvey Cc: Dan Ackroyd , Keyur Govande , Rasmus Lerdorf , "internals@lists.php.net" Content-Type: multipart/alternative; boundary=089e013c6b5a5a31420512c33864 Subject: Re: [PHP-DEV] Deprecate setlocale? From: derokorian@gmail.com (Ryan Pallas) --089e013c6b5a5a31420512c33864 Content-Type: text/plain; charset=UTF-8 On Thu, Apr 2, 2015 at 1:50 PM, Adam Harvey wrote: > On 2 April 2015 at 12:24, Dan Ackroyd wrote: > > 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? > > What about just adding another function: setlocale_global(), or > similar? I don't want a new INI setting any more than you do. > > Adam > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > I like the idea of an INI actually, but I would make it default to the current bahaviour and user education so those who need TS know to change it. Ryan --089e013c6b5a5a31420512c33864--