Poll / Kqueue on Mac OS X

Space Ship Traveller space.ship.traveller at gmail.com
Sun Dec 14 23:23:31 CET 2008


>> I see - it seems libev was trying poll because that wasn't broken in
> earlier revisions. apple did a good job breaking poll instead of  
> fixing
> kqueue in 10.5 it seems.
>
> The next release of libev will automatically use select on os x.
>
> Thanks for bringing this to my attention, I didn't expect OS X to  
> become
> even more broken :/

Poll is implemented on top of kqueue as far as I know, so thats  
possibly why it isn't working. I think this is a 10.5 thing.

I haven't benchmarked kqueue. This wasn't really about benchmarking -  
it was more about scratching my particular itch. I don't expect to  
ever have a huge number of fds to query, so at this point it is a bit  
inconsequential.

I was very confused about the original behavior of kqueue. I just  
expected it to work as you indicated. Nothing in the documentation  
indicates otherwise. So, this whole hack has been my exploration into  
the issue and finding a working solution. That helped me to confirm  
the original fault.

In my case - stdin is a very low bandwidth source of input, therefore  
I'm not too concerned about performance and the whole hack of reading  
and writing on separate threads. In my case, it solves MY problem and  
it works well.

This doesn't mean I don't understand where you are coming from.

If you have all this energy, why not file a bug report.

http://radar.apple.com/

I'm bringing the issue up further with other developers on the darwin  
mailing list. I'll end up filing a bug report when I have more  
information and can provide a good report to Apple.

Kind regards
Samuel



More information about the libev mailing list