taskqueue.9 (124066) | taskqueue.9 (130582) |
---|---|
1.\" -*- nroff -*- 2.\" 3.\" Copyright (c) 2000 Doug Rabson 4.\" 5.\" All rights reserved. 6.\" 7.\" This program is free software. 8.\" --- 12 unchanged lines hidden (view full) --- 21.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT, 22.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 23.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 27.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28.\" | 1.\" -*- nroff -*- 2.\" 3.\" Copyright (c) 2000 Doug Rabson 4.\" 5.\" All rights reserved. 6.\" 7.\" This program is free software. 8.\" --- 12 unchanged lines hidden (view full) --- 21.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT, 22.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 23.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 27.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28.\" |
29.\" $FreeBSD: head/share/man/man9/taskqueue.9 124066 2004-01-02 07:23:40Z scottl $ | 29.\" $FreeBSD: head/share/man/man9/taskqueue.9 130582 2004-06-16 08:33:57Z ru $ |
30.\" 31.Dd May 12, 2000 32.Dt TASKQUEUE 9 33.Os 34.Sh NAME 35.Nm taskqueue 36.Nd asynchronous task execution 37.Sh SYNOPSIS --- 9 unchanged lines hidden (view full) --- 47 48struct task { 49 STAILQ_ENTRY(task) ta_link; /* link for queue */ 50 int ta_pending; /* count times queued */ 51 int ta_priority; /* priority of task in queue */ 52 task_fn ta_func; /* task handler */ 53 void *ta_context; /* argument for handler */ 54}; | 30.\" 31.Dd May 12, 2000 32.Dt TASKQUEUE 9 33.Os 34.Sh NAME 35.Nm taskqueue 36.Nd asynchronous task execution 37.Sh SYNOPSIS --- 9 unchanged lines hidden (view full) --- 47 48struct task { 49 STAILQ_ENTRY(task) ta_link; /* link for queue */ 50 int ta_pending; /* count times queued */ 51 int ta_priority; /* priority of task in queue */ 52 task_fn ta_func; /* task handler */ 53 void *ta_context; /* argument for handler */ 54}; |
55 | |
56.Ed 57.Ft struct taskqueue * 58.Fn taskqueue_create "const char *name" "int mflags" "taskqueue_enqueue_fn enqueue" "void *context" 59.Ft void 60.Fn taskqueue_free "struct taskqueue *queue" 61.Ft struct taskqueue * 62.Fn taskqueue_find "const char *name" 63.Ft int --- 128 unchanged lines hidden (view full) --- 192The swi taskqueues are run via a software interrupt mechanism. 193The taskqueue_swi queue runs without the protection of the Giant kernel lock, 194and the taskqueue_swi_giant queue runs with the protection of the Giant 195kernel lock. 196The thread taskqueue runs in a kernel thread context, and tasks run from 197this thread do not run under the Giant kernel lock. 198If the caller wants to run under Giant, he should explicitly acquire and 199release Giant in his taskqueue handler routine. | 55.Ed 56.Ft struct taskqueue * 57.Fn taskqueue_create "const char *name" "int mflags" "taskqueue_enqueue_fn enqueue" "void *context" 58.Ft void 59.Fn taskqueue_free "struct taskqueue *queue" 60.Ft struct taskqueue * 61.Fn taskqueue_find "const char *name" 62.Ft int --- 128 unchanged lines hidden (view full) --- 191The swi taskqueues are run via a software interrupt mechanism. 192The taskqueue_swi queue runs without the protection of the Giant kernel lock, 193and the taskqueue_swi_giant queue runs with the protection of the Giant 194kernel lock. 195The thread taskqueue runs in a kernel thread context, and tasks run from 196this thread do not run under the Giant kernel lock. 197If the caller wants to run under Giant, he should explicitly acquire and 198release Giant in his taskqueue handler routine. |
200 | 199.Pp |
201To use these queues, 202call 203.Fn taskqueue_enqueue 204with the value of the global taskqueue variable for the queue you wish to 205use ( 206.Va taskqueue_swi , 207.Va taskqueue_swi_giant , 208or --- 22 unchanged lines hidden --- | 200To use these queues, 201call 202.Fn taskqueue_enqueue 203with the value of the global taskqueue variable for the queue you wish to 204use ( 205.Va taskqueue_swi , 206.Va taskqueue_swi_giant , 207or --- 22 unchanged lines hidden --- |