From:  weltling@outlook.de (Anatol Belski)
Date:  26 Apr 2019 20:27:09 Hong Kong Time
Newsgroup:  news.php.net/php.internals.win
Subject:  

RE: [INTERNALS-WIN] setlocale() and ZTS

NNTP-Posting-Host:  null

Hi Christoph,

> -----Original Message-----
> From: Christoph M. Becker 
> Sent: Friday, April 26, 2019 2:05 PM
> To: internals-win 
> Subject: [INTERNALS-WIN] setlocale() and ZTS
> 
> Hi,
> 
> the documentation of setlocale()[1] warns:
> 
> | The locale information is maintained per process, not per thread.
> 
> However, I noticed commit 9319359[2] (which is shipped as of PHP 5.4.0) which
> claims to "make setlocale thread only".  So I wonder whether the
> documentation is out-dated, or whether there are still threading issues
> regarding setlocale().
> 
> [1] 
> [2]
>  src.git;a=commit;h=9319359dc9f7808fad0f59970587d0bee5d22643>
> 
The mentioned commit has nothing to do with the setlocale() calls but was rather directed to SAPIs. Those are process wide and the issues are still there. Joe worked on locking lately as his parallel ext revealed some more crashes, so it might behave more stable in the upcoming versions. Still, libc locale are not thread safe and locking only can prevent some crashing potential but won't fix any functional issues in that regards. 

Regards

Anatol