From owner-cvs-all@FreeBSD.ORG Wed Mar 24 17:39:52 2004 Return-Path: Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id EA17F16A4CE; Wed, 24 Mar 2004 17:39:52 -0800 (PST) Received: from VARK.homeunix.com (adsl-69-104-80-69.dsl.pltn13.pacbell.net [69.104.80.69]) by mx1.FreeBSD.org (Postfix) with ESMTP id BCA6243D2F; Wed, 24 Mar 2004 17:39:52 -0800 (PST) (envelope-from das@FreeBSD.ORG) Received: from VARK.homeunix.com (localhost [127.0.0.1]) by VARK.homeunix.com (8.12.11/8.12.10) with ESMTP id i2P1dfC9066302; Wed, 24 Mar 2004 17:39:41 -0800 (PST) (envelope-from das@FreeBSD.ORG) Received: (from das@localhost) by VARK.homeunix.com (8.12.11/8.12.10/Submit) id i2P1df1Z066301; Wed, 24 Mar 2004 17:39:41 -0800 (PST) (envelope-from das@FreeBSD.ORG) Date: Wed, 24 Mar 2004 17:39:41 -0800 From: David Schultz To: Brian Feldman Message-ID: <20040325013941.GA65920@VARK.homeunix.com> Mail-Followup-To: Brian Feldman , src-committers@FreeBSD.ORG, cvs-src@FreeBSD.ORG, cvs-all@FreeBSD.ORG References: <200403241444.i2OEiv86083617@repoman.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200403241444.i2OEiv86083617@repoman.freebsd.org> cc: cvs-src@FreeBSD.ORG cc: src-committers@FreeBSD.ORG cc: cvs-all@FreeBSD.ORG Subject: Re: cvs commit: src/lib/libc/gen arc4random.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Mar 2004 01:39:53 -0000 On Wed, Mar 24, 2004, Brian Feldman wrote: > green 2004/03/24 06:44:57 PST > > FreeBSD src repository > > Modified files: > lib/libc/gen arc4random.c > Log: > Add locking so that arc4random(3) functions are all reentrant for > pthreads. I think you mean thread-safe, not reentrant. Also: PR: 63287 AFAIK, there's no standard for how arc4random() is supposed to behave, but the new behavior is a break from that of other BSDs, and from the behavior of random(), so the change should probably be documented in the manpage. FWIW, on my UP Pentium 4 with SMT, this adds roughly 3% overhead for unthreaded apps and 52% overhead for threaded apps. It is conceivable that an application writer would want access to the raw interface in order to serialize calls manually for efficiency, but I'm not such an application writer, so I won't complain.