Re: Using kqueue with 2 threads

2012-04-16 Thread Matthias Zitzen
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

Re: Using kqueue with 2 threads

2012-04-10 Thread Ben Short
I have put together the following example and can still see the problem. Once the file is written to extended is printed every second. If I remove the sleep then it prints a whole lot more. So it seems that the call to kevent in the worker_thread method blocks until the file is written to then it r

Using kqueue with 2 threads

2012-04-10 Thread Ben Short
Hi, I'm trying to use a kqueue to listen for VNODE events on a worker thread. I want new events to be registered with the kqueue by a separate thread. I have been referring to this example [URL=" http://doc.geoffgarside.co.uk/kqueue/file.html";] http://doc.geoffgarside.co.uk/kqueue/file.html[/UR