On Thu, Sep 17, 2009 at 07:51:58PM -0700, Gilad Benjamini wrote: > I just resolved a similar issue today, where I needed to close a file > descriptor AFTER deleting an event. > > My symptoms, though, were different. > > What underlying mechanism is your libevent using ? > > In my case it is epoll. With select or poll my scenario had no problems, in > spite of the wrong order. >
Few people do it, but these--and other--errors would be easier to catch if people checked the return value of event_del(). I often use assert(0 == event_del()), because if event_del() is failing then in all likelihood I have a bug in my code (the alternative being a bug in libevent, or a kernel bug). 'Tis better to have QA screaming at you, or a few hundred upset customers, than to roll out a buggy app to tens-of-thousands of customers and watch tech support disintegrate as you struggle to locate the source of the bug, assuming you can even get a trace. (This is also why setting NDEBUG for the "production" build is usually counter-productive.) _______________________________________________ Libevent-users mailing list Libevent-users@monkey.org http://monkeymail.org/mailman/listinfo/libevent-users