From owner-freebsd-arch Sat May 13 1:57:44 2000 Delivered-To: freebsd-arch@freebsd.org Received: from finch-post-10.mail.demon.net (finch-post-10.mail.demon.net [194.217.242.38]) by hub.freebsd.org (Postfix) with ESMTP id 4F11337B76F for ; Sat, 13 May 2000 01:57:42 -0700 (PDT) (envelope-from dfr@nlsystems.com) Received: from nlsys.demon.co.uk ([158.152.125.33] helo=herring.nlsystems.com) by finch-post-10.mail.demon.net with esmtp (Exim 2.12 #1) id 12qXjx-000FXk-0A; Sat, 13 May 2000 08:57:41 +0000 Received: from salmon.nlsystems.com (salmon.nlsystems.com [10.0.0.3]) by herring.nlsystems.com (8.9.3/8.8.8) with ESMTP id KAA21872; Sat, 13 May 2000 10:01:36 +0100 (BST) (envelope-from dfr@nlsystems.com) Date: Sat, 13 May 2000 10:02:08 +0100 (BST) From: Doug Rabson To: Daniel Eischen Cc: arch@FreeBSD.ORG Subject: Re: A new api for asynchronous task execution In-Reply-To: <200005122016.QAA17205@pcnet1.pcnet.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Fri, 12 May 2000, Daniel Eischen wrote: > Doug Rabson wrote: > > To execute all the tasks on a queue, call taskqueue_run(). When a task > > is executed, first it is removed from the queue, the value of pending is > > recorded and the field is zeroed. The function func from the task struc- > > ture is called with the value arg from the structure as its first argu- > > ment and the value of pending as its second argument. > > Minor nit. If you ever want to add more than one argument to func, > then it would be better to have pending as the first argument to > func rather than the last. I don't plan to add any more arguments to func. The void* argument should be sufficient for any context that the caller has. Originally, I didn't even have the pending argument but Nick Hibma suggested it as a simple way to deal with a task being added to a queue multiple times. -- Doug Rabson Mail: dfr@nlsystems.com Nonlinear Systems Ltd. Phone: +44 20 8442 9037 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message