Changeset View
Changeset View
Standalone View
Standalone View
share/man/man9/taskqueue.9
Show All 22 Lines | |||||
.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||||
.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | .\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||||
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | .\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||||
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | ||||
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||||
.\" | .\" | ||||
.\" $FreeBSD$ | .\" $FreeBSD$ | ||||
.\" | .\" | ||||
.Dd May 24, 2014 | .Dd December 31, 2014 | ||||
.Dt TASKQUEUE 9 | .Dt TASKQUEUE 9 | ||||
.Os | .Os | ||||
.Sh NAME | .Sh NAME | ||||
.Nm taskqueue | .Nm taskqueue | ||||
.Nd asynchronous task execution | .Nd asynchronous task execution | ||||
.Sh SYNOPSIS | .Sh SYNOPSIS | ||||
.In sys/param.h | .In sys/param.h | ||||
.In sys/kernel.h | .In sys/kernel.h | ||||
▲ Show 20 Lines • Show All 240 Lines • ▼ Show 20 Lines | |||||
would not be enqueued. | would not be enqueued. | ||||
For example, if the task is enqueued by an interrupt filter, then | For example, if the task is enqueued by an interrupt filter, then | ||||
the interrupt could be disabled. | the interrupt could be disabled. | ||||
.Pp | .Pp | ||||
The | The | ||||
.Fn taskqueue_drain_all | .Fn taskqueue_drain_all | ||||
function is used to wait for all pending and running tasks that | function is used to wait for all pending and running tasks that | ||||
are enqueued on the taskqueue to finish. | are enqueued on the taskqueue to finish. | ||||
The caller must arrange that the tasks are not re-enqueued. | Tasks posted to the taskqueue after | ||||
Note that | |||||
.Fn taskqueue_drain_all | .Fn taskqueue_drain_all | ||||
currently does not handle tasks with delayed enqueueing. | begins processing, | ||||
including pending enqueues scheduled by a previous call to | |||||
.Fn taskqueue_enqueue_timeout , | |||||
do not extend the wait time of | |||||
.Fn taskqueue_drain_all | |||||
and may complete after | |||||
.Fn taskqueue_drain_all | |||||
returns. | |||||
jhb: Do you handle tasks with delayed enqueueing? Also, you might want to reword this line a bit. | |||||
Not Done Inline ActionsDelayed enqueuing tasks are ignored. However, the previous text that I removed was confusing (at least it confused me). I've added more explicit text about tasqueue_enqueue_timeout() to address this. I've also tried to clarify that additional enqueues do not extent the wait time of the function. gibbs: Delayed enqueuing tasks are ignored. However, the previous text that I removed was confusing… | |||||
.Pp | .Pp | ||||
The | The | ||||
.Fn taskqueue_block | .Fn taskqueue_block | ||||
function blocks the taskqueue. | function blocks the taskqueue. | ||||
It prevents any enqueued but not running tasks from being executed. | It prevents any enqueued but not running tasks from being executed. | ||||
Future calls to | Future calls to | ||||
.Fn taskqueue_enqueue | .Fn taskqueue_enqueue | ||||
will enqueue tasks, but the tasks will not be run until | will enqueue tasks, but the tasks will not be run until | ||||
▲ Show 20 Lines • Show All 203 Lines • Show Last 20 Lines |
Do you handle tasks with delayed enqueueing? Also, you might want to reword this line a bit. "are ignored" might be interpreted to mean that the tasks are dropped rather than queued behind the barrier. I think what you want to say is that the drain doesn't wait for tasks posted after the call to complete, but I'm not sure of the best wording. Maybe something like "Tasks posted to the taskqueue while waiting may execute after taskqueue_drain_all has returned"