From owner-freebsd-hackers@FreeBSD.ORG Tue Nov 26 21:44:10 2013 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 274A5A60; Tue, 26 Nov 2013 21:44:10 +0000 (UTC) Received: from mail-qe0-x22b.google.com (mail-qe0-x22b.google.com [IPv6:2607:f8b0:400d:c02::22b]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D0B1520A7; Tue, 26 Nov 2013 21:44:09 +0000 (UTC) Received: by mail-qe0-f43.google.com with SMTP id 2so6379433qeb.2 for ; Tue, 26 Nov 2013 13:44:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=/XbsiqT0Vc21TRfepoH9hIwnO6scvgz60PuZdJLXVDE=; b=eyxe46/4ubkOhz6wNKbLOjtHvlBT4vkRjlZ/M0ctnYmUF0gXKpAP8u+AlQQR9Pout2 V3EKitDsJk4GpmQpnNuWydjZREVi5DGloh5ONueKYFO+p0Agknt2P65Rs1RL33Sb1VrQ UnUYixsu02JJL4ufirKeNSY+PUQNv2UErd9KlYSBQMurxy1/1RA2ix5ZQXxvXJkmFltx yPrIjNPVRUXocNdgubW1aF3xYa0oTkr92xWuoaI4mOmCWshbwIrr278uUMHvIeLkLkh+ IJ/nJe7n72HcvQ46dW6IX1786o4JU937SJG/Yd5oLqwAfMadpy4/GszXy41ElQE085vQ Du4w== MIME-Version: 1.0 X-Received: by 10.224.10.197 with SMTP id q5mr39082677qaq.76.1385502249007; Tue, 26 Nov 2013 13:44:09 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.224.207.66 with HTTP; Tue, 26 Nov 2013 13:44:08 -0800 (PST) In-Reply-To: <5295032B.4010200@FreeBSD.org> References: <525519F1.3050703@FreeBSD.org> <5295032B.4010200@FreeBSD.org> Date: Tue, 26 Nov 2013 13:44:08 -0800 X-Google-Sender-Auth: 46gvNv-HTD5V0eUxWReJvkw6v8w Message-ID: Subject: Re: taskqueue_drain_all From: Adrian Chadd To: Andriy Gapon Content-Type: text/plain; charset=ISO-8859-1 Cc: "freebsd-hackers@freebsd.org" X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Nov 2013 21:44:10 -0000 Hi, On 26 November 2013 12:23, Andriy Gapon wrote: > on 09/10/2013 11:55 Andriy Gapon said the following: >> >> I would like to propose to extend taskqueue API with taskqueue_drain_all. >> A potential use case: I have a private taskqueue, several kinds of tasks get >> executed via it and then I want to make sure that all of them are completed. >> Obviously, I have a way to ensure that no new ones get enqueued. > > Provided I do not get any no-s or why-s I am going to commit the following > slightly different version soon: > > http://people.freebsd.org/~avg/taskqueue_drain_all.diff > > P.S. > taskqueue_drain_running introduced in the above patch could also be used to add > wait semantics to taskqueue_block. > So you're going to keep taskqueue_drain() semantics of running the tasks if they're queued? -adrian