From owner-freebsd-current@freebsd.org Tue Jul 28 17:23:02 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 BB8659ADF44 for ; Tue, 28 Jul 2015 17:23:02 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-ig0-x235.google.com (mail-ig0-x235.google.com [IPv6:2607:f8b0:4001:c05::235]) (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 89DB2120 for ; Tue, 28 Jul 2015 17:23:02 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by igr7 with SMTP id 7so126198723igr.0 for ; Tue, 28 Jul 2015 10:23:01 -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; bh=2uJAa5pYiEZELtGQhAj8nklIM3lQ/ayH/j2nLt3e+OY=; b=HhSZLXQV2SZ1FwOVl2K66Z7w9U5VV9Lpds1eif8UgmLd+oVj+H6d7cPUftbN8HDt4c tHbVDJ4IYmf7jniyT3MZz6z6P0u7HuCvS5Zzcp1e7QQ5TQ2WEynKgMyWBi1cQ50isapf ne8Fopg8w+AUMi5gZOyAR4XAJuM9/GV9ttcq5zmRNGy32CFZcJ0TwGWKfpMLTMGjSHSd DG/wtNgtTHb9l98VrgWuq5P/bQ3phBoWua0oee/EXnd9or+PYiGZRXtiDz/YTsIYOFXS eJPi6eXH2VYvR4XhKHYitZ5PBfBbe+AGjMTDZBpPrMdR5CAnvtaJeK08D3oTa0vR/6Ww 1rMg== MIME-Version: 1.0 X-Received: by 10.107.35.144 with SMTP id j138mr62713057ioj.105.1438104181848; Tue, 28 Jul 2015 10:23:01 -0700 (PDT) Received: by 10.36.38.133 with HTTP; Tue, 28 Jul 2015 10:23:01 -0700 (PDT) In-Reply-To: <20150728121949.GA64588@onelab2.iet.unipi.it> References: <20150728121949.GA64588@onelab2.iet.unipi.it> Date: Tue, 28 Jul 2015 10:23:01 -0700 Message-ID: Subject: Re: eventfd lookalike in FreeBSD ? From: Adrian Chadd To: Luigi Rizzo Cc: freebsd-current Content-Type: text/plain; charset=UTF-8 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:23:02 -0000 There's a kqueue notification mechanism just for this very thing. (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..) -adrian On 28 July 2015 at 05:19, Luigi Rizzo wrote: > Hi, > for some work we are doing on bhyve, we need some lightweight mechanism that > a kernel thread can use to wake up another user thread possibly > waiting for some event. > > If the recipient of the event were a kernel thread it would simply > do a tsleep(chan...) and the sender would do a wakeup() or wakeup_one(). > > Do we have an equally simple option for a recipient that is a > userspace thread using something that is already in the kernel ? > Do we have some blocking syscall that ends up doing a tsleep in > a predictable way ? > > I suppose I could create a kqueue() descriptor and instruct the kernel > thread side to post an event instead of doing the wakeup, but > this seems a bit more expensive on both endpoints. > > cheers > luigi > _______________________________________________ > freebsd-current@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-current > To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org"