From owner-freebsd-current@freebsd.org Tue Jul 28 17:33:19 2015 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 071869AC4A8 for ; Tue, 28 Jul 2015 17:33:19 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-ig0-x229.google.com (mail-ig0-x229.google.com [IPv6:2607:f8b0:4001:c05::229]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D0AECDAB; Tue, 28 Jul 2015 17:33:18 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by igk11 with SMTP id 11so116810646igk.1; Tue, 28 Jul 2015 10:33:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=hLI8OSzf+SUexeTPf0bg7amghLS0iIw2Ht/gXnn8jxk=; b=KvvlRF4NeqAcMu0TIXAeJpdafCNkIuEmadhCmtlGv0xALnu6lcKjGDYQvzlLZ462ic 4sya1fV7WtRF24xXeiExaUT0M+GBPC6RBG/9FBP3FGvcqi8MSMuV7xz7uOJzzeLJ+pbJ n5rKxLnUJ/FhYIODUGMW/k6fec8zxXFUdWZ6pGLdx3m5PpljLvpTrUpf4BuOQkFPlIoD IimENZQWIpdquN48bQ6AQMZNCenBonlUqjRJbZqNmQX7e4mOM9wo6qLl15Ts78z2j5pi nzZNNmoPb/M9/ek81uQVSnMa8r20cArBuDDtKRl7zToaL1+VH1oWWUF8JmSVMYedDbV9 erdw== MIME-Version: 1.0 X-Received: by 10.107.27.195 with SMTP id b186mr53045740iob.140.1438104798123; Tue, 28 Jul 2015 10:33:18 -0700 (PDT) Received: by 10.36.38.133 with HTTP; Tue, 28 Jul 2015 10:33:18 -0700 (PDT) In-Reply-To: <74DCC090-6AA7-43B8-81A1-DF66BC357489@FreeBSD.org> References: <20150728121949.GA64588@onelab2.iet.unipi.it> <74DCC090-6AA7-43B8-81A1-DF66BC357489@FreeBSD.org> Date: Tue, 28 Jul 2015 10:33:18 -0700 Message-ID: Subject: Re: eventfd lookalike in FreeBSD ? From: Adrian Chadd To: David Chisnall Cc: Luigi Rizzo , freebsd-current Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jul 2015 17:33:19 -0000 On 28 July 2015 at 10:31, David Chisnall wrote: > On 28 Jul 2015, at 18:23, Adrian Chadd wrote: >> >> (What would be nice is having kqueue know about conditionals, so we >> can sleep on a cond as well as a kqueue fd+queue, but I can't have >> everything I want..) > > I recently came across a need to do something like this. Being able to a= dd condvar / mutex pairs to a kqueue and wait on a set of condition variabl= es, reacquiring the mutexes for any of the signalled ones, as well as waiti= ng for kernel events would be very useful. Windows has had this for years. It makes async network programming with thread worker queues significantly less abusive. -adrian