From owner-freebsd-current@FreeBSD.ORG Fri Nov 19 18:05:47 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 021261065670; Fri, 19 Nov 2010 18:05:47 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id C9D9E8FC17; Fri, 19 Nov 2010 18:05:46 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 6FC9A46B46; Fri, 19 Nov 2010 13:05:46 -0500 (EST) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 81DCF8A01D; Fri, 19 Nov 2010 13:05:45 -0500 (EST) From: John Baldwin To: Andriy Gapon Date: Fri, 19 Nov 2010 11:58:19 -0500 User-Agent: KMail/1.13.5 (FreeBSD/7.3-CBSD-20101102; KDE/4.4.5; amd64; ; ) References: <4CE2771F.8020109@freebsd.org> <201011160827.11628.jhb@freebsd.org> <4CE6A3B4.2080604@freebsd.org> In-Reply-To: <4CE6A3B4.2080604@freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201011191158.19118.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Fri, 19 Nov 2010 13:05:45 -0500 (EST) X-Virus-Scanned: clamav-milter 0.96.3 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-1.9 required=4.2 tests=BAYES_00 autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on bigwig.baldwin.cx Cc: freebsd-current@freebsd.org, Pawel Jakub Dawidek 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: Fri, 19 Nov 2010 18:05:47 -0000 On Friday, November 19, 2010 11:20:04 am Andriy Gapon wrote: > on 16/11/2010 15:27 John Baldwin said the following: > > On Tuesday, November 16, 2010 7:20:47 am Andriy Gapon wrote: > >> > >> 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 encompassing 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 of view. > > > > 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. > > BTW, tq_name doesn't seem to be used anywhere at all. > Perhaps just drop it? But still could be useful in a debugger, though. If it's not used anywhere I would just drop it. -- John Baldwin