Hi Pieter, On Mon, Apr 16, 2018 at 02:22:48AM +0200, PiBa-NL wrote: > EVFILT_READ, EV_ADD (8) > EVFILT_WRITE, EV_DELETE (8) > EVFILT_READ, EV_ADD (7) > Events changed:3 result:-1 err:2 <<<<<<<<<<< ERROR while deleting a non > existing event > > After this the KernelEvent for FD 7 that should read the second browser > request never happens. > I think we can conclude deleting events that don't exist is a bad thing.?
Ah that's a very interesting discovery! Indeed, the main difference between kqueue and other pollers is that kqueue batches changes (which is very cool), but apparently these changes are not idempotent so we have to be extra careful. Now it explains why not trying to delete an event (as in your first patch) results in the read to work fine! It totally makes sense. So I messed up on something there. It's possible that we'll indeed need a poll mask per direction, but I really hope we won't, as it can be cumbersome. Possibly that we can rely on the FD's state to know whether we know it or not. > Ill leave further discussion about why and how to you and Oliver :). OK, thanks! Willy

