From owner-freebsd-threads@FreeBSD.ORG Thu Jan 7 15:44:57 2010 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 710BB106568B; Thu, 7 Jan 2010 15:44:57 +0000 (UTC) (envelope-from jeremyhu@apple.com) Received: from mail-out4.apple.com (mail-out4.apple.com [17.254.13.23]) by mx1.freebsd.org (Postfix) with ESMTP id 531918FC1D; Thu, 7 Jan 2010 15:44:57 +0000 (UTC) Received: from relay15.apple.com (relay15.apple.com [17.128.113.54]) by mail-out4.apple.com (Postfix) with ESMTP id 001FA8567765; Thu, 7 Jan 2010 07:44:56 -0800 (PST) X-AuditID: 11807136-b7bafae000000e8d-35-4b460177a0f1 Received: from [17.151.100.3] (Unknown_Domain [17.151.100.3]) by relay15.apple.com (Apple SCV relay) with SMTP id 87.8D.03725.771064B4; Thu, 7 Jan 2010 07:44:56 -0800 (PST) Mime-Version: 1.0 (Apple Message framework v1077) Content-Type: multipart/signed; boundary=Apple-Mail-20--1043430417; protocol="application/pkcs7-signature"; micalg=sha1 From: Jeremy Huddleston In-Reply-To: <201001070956.25906.jhb@freebsd.org> Date: Thu, 7 Jan 2010 10:44:54 -0500 Message-Id: <8C235DD0-74DA-4E15-A722-17772E8089DE@apple.com> References: <200912052034.nB5KYfaY000395@www.freebsd.org> <201001061600.47628.jhb@freebsd.org> <56AAD075-8202-40C0-AC75-18A5CDC3B76A@apple.com> <201001070956.25906.jhb@freebsd.org> To: John Baldwin X-Mailer: Apple Mail (2.1077) X-Brightmail-Tracker: AAAAAQAAAZE= X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: freebsd-gnats-submit@freebsd.org, freebsd-threads@freebsd.org Subject: Re: threads/141198: src/lib/libc/stdio does not properly initialize mutexes X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2010 15:44:57 -0000 --Apple-Mail-20--1043430417 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On Jan 7, 2010, at 09:56, John Baldwin wrote: >> vasprintf.c.patch:+ INITEXTRA(&f); >> vdprintf.c.patch:+ INITEXTRA(&f); >> vfprintf.c.patch:+ INITEXTRA(&fake); >> vfwprintf.c.patch:+ INITEXTRA(&fake); >> vsnprintf.c.patch:+ INITEXTRA(&f); >> vsprintf.c.patch:+ INITEXTRA(&f); >> vsscanf.c.patch:+ INITEXTRA(&f); >> vswprintf.c.patch:+ INITEXTRA(&f); >> vswscanf.c.patch:+ INITEXTRA(&f); >=20 > Ah, ok. In our stdio at least these are all dummy files that are = passed to > internal stdio routines that never do any locking (e.g. __vfprintf() = which > does no locking vs vfprintf() which does use the mutex locks). I'm = not sure > if that is also true for Darwin, but in theory it should be as these = file > objects are all private stack variables that no other threads can gain = a > reference to, so no locking is needed. Yeah, we're just being cautious with these changes. It takes one clock = cycle and maintains the old (FBSD 7?) state of initializing the mutex = during INITEXTRA in those dumies... just in case something gets added = down the line which needs it. If you're confident that won't be the case for FBSD, then I believe your = initial patch is sufficient. --Apple-Mail-20--1043430417--