Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 24 Jan 2010 20:19:11 +1100
From:      Peter Jeremy <peterjeremy@acm.org>
To:        Gabor Kovesdan <gabor@FreeBSD.org>
Cc:        Kostik Belousov <kostikbel@gmail.com>, attilio@FreeBSD.org, Hajimu UMEMOTO <ume@FreeBSD.org>, current@FreeBSD.org
Subject:   Re: NLS/strerror efficiency
Message-ID:  <20100124091911.GI31243@server.vk2pj.dyndns.org>
In-Reply-To: <4B5B4F4B.3030201@FreeBSD.org>
References:  <20100119212019.GL59590@deviant.kiev.zoral.com.ua> <4B56CACF.50508@FreeBSD.org> <yge1vhgvdd3.wl%ume@mahoroba.org> <4B5B4F4B.3030201@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help

--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 <gabor@FreeBSD.org> 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 <kostikbel@gmail.com> 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--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20100124091911.GI31243>