From owner-freebsd-arch Thu May 18 13:20:23 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 084DC37B51E for ; Thu, 18 May 2000 13:20:07 -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 12sWly-0002Et-0A for arch@freebsd.org; Thu, 18 May 2000 20:19:59 +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 VAA46035 for ; Thu, 18 May 2000 21:25:08 +0100 (BST) (envelope-from dfr@nlsystems.com) Date: Thu, 18 May 2000 21:24:13 +0100 (BST) From: Doug Rabson To: arch@freebsd.org Subject: A new api for asynchronous task execution (3) Message-ID: MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="0-1970571438-958681453=:73457" Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. Send mail to mime@docserver.cac.washington.edu for more info. --0-1970571438-958681453=:73457 Content-Type: TEXT/PLAIN; charset=US-ASCII Ok, I think this version is starting to look worth committing. This one adds priority sorted queueing, uses structure field prefixes and provides convenience macros for declaring queues. TASKQUEUE(9) FreeBSD Kernel Developer's Manual TASKQUEUE(9) NAME taskqueue - asynchronous task execution SYNOPSIS #include #include #include typedef void (*task_fn)(void *context, int pending); typedef void (*taskqueue_enqueue_fn)(void *context); struct task { STAILQ_ENTRY(task) ta_link; /* link for queue */ int ta_pending; /* count times queued */ int ta_priority; /* priority of task in queue */ task_fn ta_func; /* task handler */ void *ta_context; /* argument for handler */ }; struct taskqueue * taskqueue_create(const char *name, int mflags, taskqueue_enqueue_fn enqueue, void *context) void taskqueue_free(struct taskqueue *queue) struct taskqueue * taskqueue_find(const char *name) void taskqueue_enqueue(struct taskqueue *queue, struct task *task) void taskqueue_run(struct taskqueue *queue) TASK_INIT(task, priority, func, context) TASKQUEUE_DECLARE(name) TASKQUEUE_DEFINE(name, enqueue, context, init) DESCRIPTION These functions provide a simple interface for asynchronous execution of code. The function taskqueue_create() is used to create new queues. The argu- ments to taskqueue_create() include a name which should be unique, a set of malloc(9) flags which specify whether the call to malloc() is allowed to sleep and a function which is called from taskqueue_enqueue() when a task is added to the queue to allow the queue to arrange to be run later (for instance by scheduling a software interrupt or waking a kernel thread). The function taskqueue_free() should be used to remove the queue from the global list of queues and free the memory used by the queue. Any tasks which are on the queue will be executed at this time. The system maintains a list of all queues which can be searched using taskqueue_find(). The first queue whose name matches is returned, other- wise NULL. To add a task to the list of tasks queued on a taskqueue, call taskqueue_enqueue() with pointers to the queue and task. If the task's ta_pending field is non-zero, then it is simply incremented to reflect the number of times the task was enqueued. Otherwise, the task is added to the list before the first task which has a lower ta_priority value or at the end of the list if no tasks have a lower priority. Enqueueing a task does not perform any memory allocation which makes it suitable for calling from an interrupt handler. 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 ta_pending is recorded and the field is zeroed. The function ta_func from the task structure is called with the value of the field ta_context its first ar- gument and the value of ta_pending as its second argument. A convenience macro, TASK_INIT(task, priority, func, context) is provided to initialise a task structure. The values of priority, func, and context are simply copied into the task structure fields and the ta_pending field is cleared. Two macros TASKQUEUE_DECLARE(name) and TASKQUEUE_DEFINE(name, enqueue, context, init) are used to declare a reference to a global queue and to define the implementation of the queue. The TASKQUEUE_DEFINE() macro ar- ranges to call taskqueue_create() with the values of its name, enqueue and context arguments during system initialisation. After calling taskqueue_create(), the init argument to the macro is executed as a C statement, allowing any further initialisation to be performed (such as registering an interrupt handler etc.) The system provides a global taskqueue, taskqueue_swi, which is run via a software interrupt mechanism. To use this queue, call taskqueue_enqueue() with the value of the global variable taskqueue_swi. The queue will be run at splsofttq(). This queue can be used, for instance, for implementing interrupt handlers which must perform a significant amount of processing in the handler. The hardware interrupt handler would perform minimal processing of the interrupt and then enqueue a task to finish the work. This reduces the amount of time spent with interrupts disabled to a minimum. HISTORY This interface first appeared in FreeBSD 5.0. There is a similar facili- ty called tqueue in the Linux kernel. AUTHORS This man page was written by Doug Rabson. FreeBSD May 12, 2000 2 -- Doug Rabson Mail: dfr@nlsystems.com Nonlinear Systems Ltd. Phone: +44 20 8442 9037 --0-1970571438-958681453=:73457 Content-Type: TEXT/PLAIN; charset=US-ASCII; name="taskqueue.9" Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: Content-Disposition: attachment; filename="taskqueue.9" LlwiIC0qLSBucm9mZiAtKi0NCi5cIg0KLlwiIENvcHlyaWdodCAoYykgMjAw MCBEb3VnIFJhYnNvbg0KLlwiDQouXCIgQWxsIHJpZ2h0cyByZXNlcnZlZC4N Ci5cIg0KLlwiIFRoaXMgcHJvZ3JhbSBpcyBmcmVlIHNvZnR3YXJlLg0KLlwi DQouXCIgUmVkaXN0cmlidXRpb24gYW5kIHVzZSBpbiBzb3VyY2UgYW5kIGJp bmFyeSBmb3Jtcywgd2l0aCBvciB3aXRob3V0DQouXCIgbW9kaWZpY2F0aW9u LCBhcmUgcGVybWl0dGVkIHByb3ZpZGVkIHRoYXQgdGhlIGZvbGxvd2luZyBj b25kaXRpb25zDQouXCIgYXJlIG1ldDoNCi5cIiAxLiBSZWRpc3RyaWJ1dGlv bnMgb2Ygc291cmNlIGNvZGUgbXVzdCByZXRhaW4gdGhlIGFib3ZlIGNvcHly aWdodA0KLlwiICAgIG5vdGljZSwgdGhpcyBsaXN0IG9mIGNvbmRpdGlvbnMg YW5kIHRoZSBmb2xsb3dpbmcgZGlzY2xhaW1lci4NCi5cIiAyLiBSZWRpc3Ry aWJ1dGlvbnMgaW4gYmluYXJ5IGZvcm0gbXVzdCByZXByb2R1Y2UgdGhlIGFi b3ZlIGNvcHlyaWdodA0KLlwiICAgIG5vdGljZSw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Y2lsaXR5IGNhbGxlZCB0cXVldWUgaW4g dGhlIExpbnV4IGtlcm5lbC4NCi5TaCBBVVRIT1JTDQpUaGlzIG1hbiBwYWdl IHdhcyB3cml0dGVuIGJ5DQouQW4gRG91ZyBSYWJzb24gLg0K --0-1970571438-958681453=:73457 Content-Type: TEXT/PLAIN; charset=US-ASCII; name="taskqueue.h" Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: Content-Disposition: attachment; filename="taskqueue.h" LyotDQogKiBDb3B5cmlnaHQgKGMpIDIwMDAgRG91ZyBSYWJzb24NCiAqIEFs bCByaWdodHMgcmVzZXJ2ZWQuDQogKg0KICogUmVkaXN0cmlidXRpb24gYW5k IHVzZSBpbiBzb3VyY2UgYW5kIGJpbmFyeSBmb3Jtcywgd2l0aCBvciB3aXRo b3V0DQogKiBtb2RpZmljYXRpb24sIGFyZSBwZXJtaXR0ZWQgcHJvdmlkZWQg dGhhdCB0aGUgZm9sbG93aW5nIGNvbmRpdGlvbnMNCiAqIGFyZSBtZXQ6DQog KiAxLiBSZWRpc3RyaWJ1dGlvbnMgb2Ygc291cmNlIGNvZGUgbXVzdCByZXRh aW4gdGhlIGFib3ZlIGNvcHlyaWdodA0KICogICAgbm90aWNlLCB0aGlzIGxp c3Qgb2YgY29uZGl0aW9ucyBhbmQgdGhlIGZvbGxvd2luZyBkaXNjbGFpbWVy Lg0KICogMi4gUmVkaXN0cmlidXRpb25zIGluIGJpbmFyeSBmb3JtIG11c3Qg cmVwcm9kdWNlIHRoZSBhYm92ZSBjb3B5cmlnaHQNCiAqICAgIG5vdGljZSwg dGhpcyBsaXN0IG9mIGNvbmRpdGlvbnMgYW5kIHRoZSBmb2xsb3dpbmcgZGlz Y2xhaW1lciBpbiB0aGUNCiAqICAgIGRvY3VtZW50YXRpb24gYW5kL29yIG90 aGVyIG1hdGVyaWFscyBwcm92aWRlZCB3aXRoIHRoZSBkaXN0cmlidXRpb24u DQogKg0KICogVEhJUyBTT0ZUV0FSRSBJUyBQU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WQgKmFyZykJCQkJCVwNCnsJCQkJCQkJCQlcDQoJdGFza3F1ZXVlXyMjbmFt ZSA9CQkJCQkJXA0KCQl0YXNrcXVldWVfY3JlYXRlKCNuYW1lLCBNX05PV0FJ VCwgZW5xdWV1ZSwgY29udGV4dCk7CVwNCglpbml0OwkJCQkJCQkJXA0KfQkJ CQkJCQkJCVwNCgkJCQkJCQkJCVwNClNZU0lOSVQodGFza3F1ZXVlXyMjbmFt ZSwgU0lfU1VCX0NPTkZJR1VSRSwgU0lfT1JERVJfU0VDT05ELAkJXA0KCXRh c2txdWV1ZV9kZWZpbmVfIyNuYW1lLCBOVUxMKTsNCg0KLyoNCiAqIFRoaXMg cXVldWUgaXMgc2VydmljZWQgYnkgYSBzb2Z0d2FyZSBpbnRlcnJ1cHQgaGFu ZGxlci4gVG8gZW5xdWV1ZQ0KICogYSB0YXNrLCBjYWxsIHRhc2txdWV1ZV9l bnF1ZXVlKCZ0YXNrcXVldWVfc3dpLCAmdGFzaykuDQogKi8NClRBU0tRVUVV RV9ERUNMQVJFKHN3aSk7DQoNCiNlbmRpZiAvKiBfS0VSTkVMICovDQoNCiNl bmRpZiAvKiAhX1NZU19UQVNLUVVFVUVfSF8gKi8NCg== --0-1970571438-958681453=:73457 Content-Type: TEXT/PLAIN; charset=US-ASCII; name="subr_taskqueue.c" Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: Content-Disposition: attachment; filename="subr_taskqueue.c" LyotDQogKiBDb3B5cmlnaHQgKGMpIDIwMDAgRG91ZyBSYWJzb24NCiAqIEFs bCByaWdodHMgcmVzZXJ2ZWQuDQogKg0KICogUmVkaXN0cmlidXRpb24gYW5k IHVzZSBpbiBzb3VyY2UgYW5kIGJpbmFyeSBmb3Jtcywgd2l0aCBvciB3aXRo b3V0DQogKiBtb2RpZmljYXRpb24sIGFyZSBwZXJtaXR0ZWQgcHJvdmlkZWQg dGhhdCB0aGUgZm9sbG93aW5nIGNvbmRpdGlvbnMNCiAqIGFyZSBtZX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BlbmRpbmcgPSAwOw0KCQlz cGx4KHMpOw0KDQoJCXRhc2stPnRhX2Z1bmModGFzay0+dGFfY29udGV4dCwg cGVuZGluZyk7DQoNCgkJcyA9IHNwbGhpZ2goKTsNCgl9DQoJc3BseChzKTsN Cn0NCg0Kc3RhdGljIHZvaWQNCnRhc2txdWV1ZV9zd2lfZW5xdWV1ZSh2b2lk ICpjb250ZXh0KQ0Kew0KCXNldHNvZnR0cSgpOw0KfQ0KDQpzdGF0aWMgdm9p ZA0KdGFza3F1ZXVlX3N3aV9ydW4odm9pZCkNCnsNCgl0YXNrcXVldWVfcnVu KHRhc2txdWV1ZV9zd2kpOw0KfQ0KDQpUQVNLUVVFVUVfREVGSU5FKHN3aSwg dGFza3F1ZXVlX3N3aV9lbnF1ZXVlLCAwLA0KCQkgcmVnaXN0ZXJfc3dpKFNX SV9UUSwgdGFza3F1ZXVlX3N3aV9ydW4pKTsNCg== --0-1970571438-958681453=:73457-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message