Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 17 May 2000 21:33:17 +0100 (BST)
From:      Doug Rabson <dfr@nlsystems.com>
To:        Terry Lambert <tlambert@primenet.com>
Cc:        Mike Smith <msmith@FreeBSD.ORG>, Nick Hibma <n_hibma@calcaphon.com>, arch@FreeBSD.ORG
Subject:   Re: A new api for asynchronous task execution
Message-ID:  <Pine.BSF.4.21.0005172131300.47945-100000@salmon.nlsystems.com>
In-Reply-To: <200005171745.KAA06412@usr05.primenet.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 17 May 2000, Terry Lambert wrote:

> > 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).

The BSD/OS mutex code includes a compile-time-selected debugging feature
which automatically detects locking hierarchy violations. Anyway, using a
mutex here doesn't add to locking complexity since the mutex would be
exited before calling the task's callback and re-entered after.

-- 
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0005172131300.47945-100000>