From owner-freebsd-current@FreeBSD.ORG Tue Nov 16 13:42:27 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7D1A3106566C; Tue, 16 Nov 2010 13:42:27 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: from mail.garage.freebsd.pl (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id 23C368FC18; Tue, 16 Nov 2010 13:42:26 +0000 (UTC) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id 692C945CAC; Tue, 16 Nov 2010 14:42:24 +0100 (CET) Received: from localhost (pdawidek.whl [10.0.1.1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id 5ABD545C9C; Tue, 16 Nov 2010 14:42:19 +0100 (CET) Date: Tue, 16 Nov 2010 14:41:37 +0100 From: Pawel Jakub Dawidek To: John Baldwin Message-ID: <20101116134137.GD1753@garage.freebsd.pl> References: <4CE2771F.8020109@freebsd.org> <201011160827.11628.jhb@freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="oPmsXEqKQNHCSXW7" Content-Disposition: inline In-Reply-To: <201011160827.11628.jhb@freebsd.org> User-Agent: Mutt/1.4.2.3i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 9.0-CURRENT amd64 X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-5.9 required=4.5 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.0.4 Cc: freebsd-current@freebsd.org, Andriy Gapon Subject: Re: taskqueue_create() name parameter lieftime X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Nov 2010 13:42:27 -0000 --oPmsXEqKQNHCSXW7 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Nov 16, 2010 at 08:27:11AM -0500, John Baldwin wrote: > On Tuesday, November 16, 2010 7:20:47 am Andriy Gapon wrote: > >=20 > > taskqueue_create() documentation never explicitly says this, but current > > taskqueue_create() implementation just stores a 'name' pointer parameter > > internally. Thus it depends on the 'name' having a life time encompass= ing that of > > the taskqueue. > > I think that alternatively we could have copied the name (or a portion = of it) into > > an internal buffer. > > I don't any argument for either approach, just curious which one looks = more > > preferable from general (FreeBSD, kernel) programming practices point o= f view. >=20 > Hmm, in many other places we store a separate copy (e.g. all the interrupt > code uses separate MAXCOMLEN char arrays to hold names). If that is easy= to > do, that is probably the best approach. The most friendly API would keep the name internally, but would also allow me to provide name in printf-like format, so I don't have to use sprint()/snprintf() before calling it. This unfortunatelly will change taskqueue API as name is the first argument, which makes it not worth the pain. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --oPmsXEqKQNHCSXW7 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAkziihEACgkQForvXbEpPzTE3ACgxYxc+eVUNuGtflV+plOW3Sdb 4C0AmwYQOvFv+CRYkfNcleDxjQZLpzAF =lJer -----END PGP SIGNATURE----- --oPmsXEqKQNHCSXW7--