Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 19 Nov 2010 11:58:19 -0500
From:      John Baldwin <jhb@freebsd.org>
To:        Andriy Gapon <avg@freebsd.org>
Cc:        freebsd-current@freebsd.org, Pawel Jakub Dawidek <pjd@freebsd.org>
Subject:   Re: taskqueue_create() name parameter lieftime
Message-ID:  <201011191158.19118.jhb@freebsd.org>
In-Reply-To: <4CE6A3B4.2080604@freebsd.org>
References:  <4CE2771F.8020109@freebsd.org> <201011160827.11628.jhb@freebsd.org> <4CE6A3B4.2080604@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201011191158.19118.jhb>