From owner-freebsd-arch Wed May 17 10:46: 3 2000 Delivered-To: freebsd-arch@freebsd.org Received: from smtp04.primenet.com (smtp04.primenet.com [206.165.6.134]) by hub.freebsd.org (Postfix) with ESMTP id F00C637BA9F; Wed, 17 May 2000 10:45:57 -0700 (PDT) (envelope-from tlambert@usr05.primenet.com) Received: (from daemon@localhost) by smtp04.primenet.com (8.9.3/8.9.3) id KAA15132; Wed, 17 May 2000 10:45:24 -0700 (MST) Received: from usr05.primenet.com(206.165.6.205) via SMTP by smtp04.primenet.com, id smtpdAAATyaWGD; Wed May 17 10:45:17 2000 Received: (from tlambert@localhost) by usr05.primenet.com (8.8.5/8.8.5) id KAA06412; Wed, 17 May 2000 10:45:44 -0700 (MST) From: Terry Lambert Message-Id: <200005171745.KAA06412@usr05.primenet.com> Subject: Re: A new api for asynchronous task execution To: dfr@nlsystems.com (Doug Rabson) Date: Wed, 17 May 2000 17:45:44 +0000 (GMT) Cc: msmith@FreeBSD.ORG (Mike Smith), n_hibma@calcaphon.com (Nick Hibma), arch@FreeBSD.ORG In-Reply-To: from "Doug Rabson" at May 15, 2000 09:44:41 AM X-Mailer: ELM [version 2.5 PL2] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > I do hope to be able to replace at least some of these pieces. I like the > idea of a priority sorted list of tasks, probably using a priority field > in struct task. Bletch. This is a job best handled by managing insertion order, rather than by way of an explicit sort. Insertion order also keeps the structure both small and generic. > As Chuck noted, a queue name will be useful for initialising SMP mutexes > so I'll add that to taskqueue_init(). It should be easy to leverage that > into something like taskqueue_find(). I dislike the idea of explicit kernel mutex queues, as opposed to resource queues. The problem you run into is the inability to perform deadlock avoidance, which you would normally do by implying an edge between the top of the hierarchy into which you are inserting and the location into which you wish to insert (such an algorithm is order N+1 based on depth N and doing a reverse traversal in an attempt to detect a Hamiltonian cyclye introduced by the implication of the edge; short of caching the edge node, which would give you order N, but cost significantly, this is about the best possible algorithm you can get). Terry Lambert terry@lambert.org --- Any opinions in this posting are my own and not those of my present or previous employers. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message