Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 28 Jul 2015 10:23:01 -0700
From:      Adrian Chadd <adrian.chadd@gmail.com>
To:        Luigi Rizzo <rizzo@iet.unipi.it>
Cc:        freebsd-current <freebsd-current@freebsd.org>
Subject:   Re: eventfd lookalike in FreeBSD ?
Message-ID:  <CAJ-VmoniGM2wv01zn_%2B%2BF-fLOq4mZ5FFTZRX_dYLww51Aq-iJQ@mail.gmail.com>
In-Reply-To: <20150728121949.GA64588@onelab2.iet.unipi.it>
References:  <20150728121949.GA64588@onelab2.iet.unipi.it>

next in thread | previous in thread | raw e-mail | index | archive | help
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 <rizzo@iet.unipi.it> 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"



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAJ-VmoniGM2wv01zn_%2B%2BF-fLOq4mZ5FFTZRX_dYLww51Aq-iJQ>