From owner-freebsd-current@freebsd.org Tue Jul 28 12:19:03 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 2AC7E9AB928 for ; Tue, 28 Jul 2015 12:19:03 +0000 (UTC) (envelope-from luigi@onelab2.iet.unipi.it) Received: from onelab2.iet.unipi.it (onelab2.iet.unipi.it [131.114.59.238]) by mx1.freebsd.org (Postfix) with ESMTP id EB262280 for ; Tue, 28 Jul 2015 12:19:02 +0000 (UTC) (envelope-from luigi@onelab2.iet.unipi.it) Received: by onelab2.iet.unipi.it (Postfix, from userid 275) id C6F837300A; Tue, 28 Jul 2015 14:19:49 +0200 (CEST) Date: Tue, 28 Jul 2015 14:19:49 +0200 From: Luigi Rizzo To: freebsd-current@freebsd.org Subject: eventfd lookalike in FreeBSD ? Message-ID: <20150728121949.GA64588@onelab2.iet.unipi.it> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) 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 12:19:03 -0000 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