From owner-svn-src-all@FreeBSD.ORG Fri Mar 23 21:30:42 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 67F38106566B; Fri, 23 Mar 2012 21:30:42 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay04.stack.nl [IPv6:2001:610:1108:5010::107]) by mx1.freebsd.org (Postfix) with ESMTP id 02B928FC0C; Fri, 23 Mar 2012 21:30:42 +0000 (UTC) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id BDF731E2B1B; Fri, 23 Mar 2012 22:30:40 +0100 (CET) Received: by snail.stack.nl (Postfix, from userid 1677) id 9D93A2847A; Fri, 23 Mar 2012 22:30:40 +0100 (CET) Date: Fri, 23 Mar 2012 22:30:40 +0100 From: Jilles Tjoelker To: Ed Schouten Message-ID: <20120323213040.GA70656@stack.nl> References: <201203230826.q2N8QW0m064618@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201203230826.q2N8QW0m064618@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r233345 - head/lib/libc/gen X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Mar 2012 21:30:42 -0000 On Fri, Mar 23, 2012 at 08:26:32AM +0000, Ed Schouten wrote: > Author: ed > Date: Fri Mar 23 08:26:31 2012 > New Revision: 233345 > URL: http://svn.freebsd.org/changeset/base/233345 > Log: > Make utmpx(3) thread safe if we support TLS. > Because the utmpx interface is generally not required to be thread-safe, > but it is nice to have, if easy to do so. Therefore don't make a mess > out of the code and only use it if __NO_TLS is not defined. Hmm, I think this is a portability trap, at least as long it is supported to have a platform with threading but without __NO_TLS. Besides, I am not sure if this functionality is worth 12 or 20 bytes of memory per thread because most applications do not use it. I think a pthread_key_create() when the first thread calls an utmpx function optimizes for the case where utmpx is not used or used by only one thread. A reason to make utmpx thread-safe could be that glibc does it or popular applications (almost) need it. -- Jilles Tjoelker