Date: Mon, 16 Apr 2012 09:34:30 +0200 From: Matthias Zitzen <m.zitzen@o-notation.org> To: freebsd-questions@freebsd.org Subject: Re: Using kqueue with 2 threads Message-ID: <4F8BCB86.10805@o-notation.org> In-Reply-To: <CAOiKr=tV7GioR4gVnXQmWx=HU4yzpzubAdsiycJHZcxTGJ2FKw@mail.gmail.com> References: <CAOiKr=t3V=MWCc6Z_%2BskZYkS-jrXwXUiOkuOk7N_sBCaKWMZxQ@mail.gmail.com> <CAOiKr=tV7GioR4gVnXQmWx=HU4yzpzubAdsiycJHZcxTGJ2FKw@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
Hello, Am 10.04.2012 21:52, schrieb Ben Short: >> EV_SET(&ke, fd, EVFILT_VNODE, EV_ADD, NOTE_DELETE | NOTE_RENAME | >> NOTE_EXTEND, 0, NULL); >> >> if (kevent(kq,&ke, 1, NULL, 0, NULL) == -1) { >> std::cerr<< "kevent produced error: "<< strerror(errno)<< >> std::endl; >> }[/CODE] >> Did i understand right, that after registering and firing one event the kevent() function doesn't block any more? If so, register the events with EV_ADD | EV_CLEAR. With this flag, the event state is cleared and kevent() is still blocking(man kqueue). That flag was solving my problem... Matthias
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4F8BCB86.10805>