Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:225 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 64388 invoked from network); 24 Mar 2003 19:11:33 -0000 Received: from unknown (HELO gateway.zk3.dec.com) (206.152.163.42) by pb1.pair.com with SMTP; 24 Mar 2003 19:11:33 -0000 Received: by gateway.zk3.dec.com; (5.65v4.0/1.3/10May95) id AA31162; Mon, 24 Mar 2003 14:11:32 -0500 Received: from little1 by lead.zk3.dec.com (8.12.1/1.1.20.3/27Apr99-0346PM) id h2OJBVVL102604; Mon, 24 Mar 2003 14:11:31 -0500 (EST) Message-ID: <007b01c2f239$2bdce630$e3008d10@little1> To: "Nathan Fredrickson" , "php.internals" References: Date: Mon, 24 Mar 2003 14:11:26 -0500 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-Msmail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1106 X-Mimeole: Produced By Microsoft MimeOLE V6.00.2800.1106 Subject: Re: [PHP-DEV] issues with gettext on multithreaded servers From: ddhill@php.net ("David Hill \(php.net\)") > I have found some problems (and possible solutions) concerning use of the > gettext extension on multithreaded servers. The gettext library caches information in static variables..... This is true in gettext 0.10.40 at least, which is that last that I looked in. This has a number of "features" that are less than desirable with PHP. First - thread safety.... what thread saftey ? Second - as the locale is cached in static data when gettext is first initialized, I have yet to figure out how you could use this to support multiple locales in series (ie Apache 1.3) much less in parallel (Apache 2.0 with worker). I found that after changing the local variable, and then reopening the cat file that I was getting the old local, which is why I went looking into this. This of course was made more fun by that fact that I had 20 Apache procs running - each with a different cached locale as I was trying to figure out my semi random results. Maybe I missed something when I was looking into this (like some other way to call gettext). If so I would love to hear about it. dave