From owner-cvs-src-old@FreeBSD.ORG Mon Jan 25 23:38:01 2010 Return-Path: Delivered-To: cvs-src-old@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B0231106566B for ; Mon, 25 Jan 2010 23:38:01 +0000 (UTC) (envelope-from gabor@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 9DCAA8FC12 for ; Mon, 25 Jan 2010 23:38:01 +0000 (UTC) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id o0PNc1tN038727 for ; Mon, 25 Jan 2010 23:38:01 GMT (envelope-from gabor@repoman.freebsd.org) Received: (from svn2cvs@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id o0PNc1Qr038726 for cvs-src-old@freebsd.org; Mon, 25 Jan 2010 23:38:01 GMT (envelope-from gabor@repoman.freebsd.org) Message-Id: <201001252338.o0PNc1Qr038726@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: svn2cvs set sender to gabor@repoman.freebsd.org using -f From: Gabor Kovesdan Date: Mon, 25 Jan 2010 23:37:49 +0000 (UTC) To: cvs-src-old@freebsd.org X-FreeBSD-CVS-Branch: HEAD Subject: cvs commit: src/lib/libc/nls msgcat.c X-BeenThere: cvs-src-old@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: **OBSOLETE** CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jan 2010 23:38:01 -0000 gabor 2010-01-25 23:37:49 UTC FreeBSD src repository Modified files: lib/libc/nls msgcat.c Log: SVN rev 202992 on 2010-01-25 23:37:49Z by gabor Cache failing and opened catalogs in catopen() and related functions. Continuous catopen() calls cause 4 failig stat(2) each, which means a lot of overhead. It is also a good idea to keep the opened catalogs in the memory to speed up further catopen() calls to the same catalog since these catalogs are not big at all. In this case, we count references and only free() the allocated space when the reference count reaches 0. The reads and writes to the cache are syncronized with an rwlock when these functions are called from a threaded program. Requested by: kib Approved by: delphij Revision Changes Path 1.51 +131 -17 src/lib/libc/nls/msgcat.c