From owner-freebsd-current@FreeBSD.ORG Sun Jan 24 09:19:19 2010 Return-Path: Delivered-To: current@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C7485106566B; Sun, 24 Jan 2010 09:19:19 +0000 (UTC) (envelope-from peterjeremy@acm.org) Received: from mail34.syd.optusnet.com.au (mail34.syd.optusnet.com.au [211.29.133.218]) by mx1.freebsd.org (Postfix) with ESMTP id 4C61B8FC17; Sun, 24 Jan 2010 09:19:18 +0000 (UTC) Received: from server.vk2pj.dyndns.org (c122-106-232-148.belrs3.nsw.optusnet.com.au [122.106.232.148]) by mail34.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id o0O9JGHA001633 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 24 Jan 2010 20:19:17 +1100 X-Bogosity: Ham, spamicity=0.000000 Received: from server.vk2pj.dyndns.org (localhost.vk2pj.dyndns.org [127.0.0.1]) by server.vk2pj.dyndns.org (8.14.3/8.14.3) with ESMTP id o0O9JBtw018713; Sun, 24 Jan 2010 20:19:11 +1100 (EST) (envelope-from peter@server.vk2pj.dyndns.org) Received: (from peter@localhost) by server.vk2pj.dyndns.org (8.14.3/8.14.3/Submit) id o0O9JBr6018712; Sun, 24 Jan 2010 20:19:11 +1100 (EST) (envelope-from peter) Date: Sun, 24 Jan 2010 20:19:11 +1100 From: Peter Jeremy To: Gabor Kovesdan Message-ID: <20100124091911.GI31243@server.vk2pj.dyndns.org> References: <20100119212019.GL59590@deviant.kiev.zoral.com.ua> <4B56CACF.50508@FreeBSD.org> <4B5B4F4B.3030201@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="SdaPbLtAangIkrMZ" Content-Disposition: inline In-Reply-To: <4B5B4F4B.3030201@FreeBSD.org> X-PGP-Key: http://members.optusnet.com.au/peterjeremy/pubkey.asc User-Agent: Mutt/1.5.20 (2009-06-14) Cc: Kostik Belousov , attilio@FreeBSD.org, Hajimu UMEMOTO , current@FreeBSD.org Subject: Re: NLS/strerror efficiency X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Jan 2010 09:19:19 -0000 --SdaPbLtAangIkrMZ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2010-Jan-23 20:34:35 +0100, Gabor Kovesdan wrote: >I have a fix for msgcat.c to optimalize catalog handling. As I'm not an=20 >src committer, delphij@ is helping me in reviewing and approving my=20 >patches. I've sent the attached patch to him today and I'm waiting for=20 >his response now. This patch caches the failing and the succesful=20 >catopen() calls in a thread-safe way and in the latter case it counts=20 >references to cached catalog. I think this is a good start but still needs some work. One issue is that the patch mixes whitespace changes (some not complying with style(9)) and functional changes. This makes it harder to see the functional changes. On 2010-Jan-23 21:38:35 +0200, Kostik Belousov wrote: >Wouldn't this cause the locale for error strings to be fixated at the >time of the first strerror/gai_strerror call ? Yes. >Current code, despite it inefficiency, allow dynamic change of locale >that is reflected in strerror() output, I believe. How much of an issue is this in reality? There are two cases to consider: 1) A process that dynamically changes its locale. 2) Locale files being updated whilst the process is running. The first can be worked around by also caching the current locale and checking that it hasn't changed. The second is more problematic - particularly for long-running programs. Maybe add a timestamp and re-check every minute or 5. --=20 Peter Jeremy --SdaPbLtAangIkrMZ Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAktcEI8ACgkQ/opHv/APuIfgdwCgwhA4UHUj3sq4hh8a7NW0etga hpoAoKKWdpMZOuMlXQeEtHtmLMsrxq6O =Mi+e -----END PGP SIGNATURE----- --SdaPbLtAangIkrMZ--