taskqueue.9 (196358) | taskqueue.9 (210377) |
---|---|
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 196358 2009-08-18 13:55:48Z pjd $ | 29.\" $FreeBSD: head/share/man/man9/taskqueue.9 210377 2010-07-22 16:41:09Z mdf $ |
30.\" 31.Dd August 18, 2009 32.Dt TASKQUEUE 9 33.Os 34.Sh NAME 35.Nm taskqueue 36.Nd asynchronous task execution 37.Sh SYNOPSIS --- 21 unchanged lines hidden (view full) --- 59.Fn taskqueue_create_fast "const char *name" "int mflags" "taskqueue_enqueue_fn enqueue" "void *context" 60.Ft void 61.Fn taskqueue_free "struct taskqueue *queue" 62.Ft int 63.Fn taskqueue_enqueue "struct taskqueue *queue" "struct task *task" 64.Ft int 65.Fn taskqueue_enqueue_fast "struct taskqueue *queue" "struct task *task" 66.Ft void | 30.\" 31.Dd August 18, 2009 32.Dt TASKQUEUE 9 33.Os 34.Sh NAME 35.Nm taskqueue 36.Nd asynchronous task execution 37.Sh SYNOPSIS --- 21 unchanged lines hidden (view full) --- 59.Fn taskqueue_create_fast "const char *name" "int mflags" "taskqueue_enqueue_fn enqueue" "void *context" 60.Ft void 61.Fn taskqueue_free "struct taskqueue *queue" 62.Ft int 63.Fn taskqueue_enqueue "struct taskqueue *queue" "struct task *task" 64.Ft int 65.Fn taskqueue_enqueue_fast "struct taskqueue *queue" "struct task *task" 66.Ft void |
67.Fn taskqueue_run "struct taskqueue *queue" 68.Ft void 69.Fn taskqueue_run_fast "struct taskqueue *queue" 70.Ft void | |
71.Fn taskqueue_drain "struct taskqueue *queue" "struct task *task" 72.Ft int 73.Fn taskqueue_member "struct taskqueue *queue" "struct thread *td" 74.Fn TASK_INIT "struct task *task" "int priority" "task_fn_t *func" "void *context" 75.Fn TASKQUEUE_DECLARE "name" 76.Fn TASKQUEUE_DEFINE "name" "taskqueue_enqueue_fn enqueue" "void *context" "init" 77.Fn TASKQUEUE_FAST_DEFINE "name" "taskqueue_enqueue_fn enqueue" "void *context" "init" 78.Fn TASKQUEUE_DEFINE_THREAD "name" --- 59 unchanged lines hidden (view full) --- 138The function 139.Fn taskqueue_enqueue_fast 140should be used in place of 141.Fn taskqueue_enqueue 142when the enqueuing must happen from a fast interrupt handler. 143This method uses spin locks to avoid the possibility of sleeping in the fast 144interrupt context. 145.Pp | 67.Fn taskqueue_drain "struct taskqueue *queue" "struct task *task" 68.Ft int 69.Fn taskqueue_member "struct taskqueue *queue" "struct thread *td" 70.Fn TASK_INIT "struct task *task" "int priority" "task_fn_t *func" "void *context" 71.Fn TASKQUEUE_DECLARE "name" 72.Fn TASKQUEUE_DEFINE "name" "taskqueue_enqueue_fn enqueue" "void *context" "init" 73.Fn TASKQUEUE_FAST_DEFINE "name" "taskqueue_enqueue_fn enqueue" "void *context" "init" 74.Fn TASKQUEUE_DEFINE_THREAD "name" --- 59 unchanged lines hidden (view full) --- 134The function 135.Fn taskqueue_enqueue_fast 136should be used in place of 137.Fn taskqueue_enqueue 138when the enqueuing must happen from a fast interrupt handler. 139This method uses spin locks to avoid the possibility of sleeping in the fast 140interrupt context. 141.Pp |
146To execute all the tasks on a queue, 147call 148.Fn taskqueue_run 149or 150.Fn taskqueue_run_fast 151depending on the flavour of the queue. | |
152When a task is executed, 153first it is removed from the queue, 154the value of 155.Va ta_pending 156is recorded and then the field is zeroed. 157The function 158.Va ta_func 159from the task structure is called with the value of the field --- 164 unchanged lines hidden --- | 142When a task is executed, 143first it is removed from the queue, 144the value of 145.Va ta_pending 146is recorded and then the field is zeroed. 147The function 148.Va ta_func 149from the task structure is called with the value of the field --- 164 unchanged lines hidden --- |