Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 25 Mar 2015 23:42:51 +0100
From:      Jilles Tjoelker <jilles@stack.nl>
To:        Ivan Radovanovic <radovanovic@gmail.com>
Cc:        freebsd-hackers@FreeBSD.org
Subject:   Re: kevent behavior
Message-ID:  <20150325224251.GB79065@stack.nl>
In-Reply-To: <5512C835.7040207@gmail.com>
References:  <550A6DA2.1070004@gmail.com> <20150324221541.GA67584@stack.nl> <5512C835.7040207@gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Mar 25, 2015 at 03:37:41PM +0100, Ivan Radovanovic wrote:
> I saw this EVFILT_USER thing, and it looked to me like it could be used 
> to do much smarter unblocking of kevent but I believe manual page is 
> relatively unclear there - what I do not understand is:

> * how you trigger this user event (I would say with kevent if 
> corresponding structure's NOTE_TRIGGER flag is set, but that doesn't 
> sound logical since in my understanding kevent is basically like 
> select(2) (ie call which checks if something happened without triggering 
> things = call which reports about status change in system without 
> causing change itself)?

The changelist passed to kevent(2) causes changes to the kqueue. One
kevent(2) call can both change what is monitored and check whether
something has happened.

An example of EVFILT_USER is in tools/regression/kqueue/user.c.

> * how does this work process-wise - is one ident restricted to process 
> which created corresponding kqueue, or it is system wise (other process 
> could trigger my kevent if same ident value is used)?

The ident is per kqueue.

-- 
Jilles Tjoelker



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20150325224251.GB79065>