Spent last week and this weekend settling in to the new house. Heather has done most of the unpacking, and I'm immensely grateful to her for that. This has allowed me to just get on with work while the chaos continues around me.
Today I've mostly been writing a perl module for calling the BSD/MacOSX kqueue() system call. I thought at first to try just using perl's syscall() command to do it, but I'm not entirely convinced that is possible due to requiring memory allocation and so forth. So instead I wrote a simple XS wrapper called IO::KQueue (I'm sure the module naming overlords will shoot me for that).
If anyone would like to test it please email me - I'd like to at least know it works on FreeBSD before uploading to CPAN. It requires perl 5.8 though (for ExtUtils::Constant).
The reason I've been doing this is that I've been working on highly scalable/parallel clients again. There's some modules for doing this kind of work (POE, Event, IO::Select, IO::Multiplex, etc) but none are really simple enough to achieve the kind of scalability I require. Instead I've been building on Brad Fitzpatrick's Danga::Socket code which he uses in perlbal - his perl based load balancer. Danga::Socket will transparently use epoll() if it's on your system, or poll() if not. I'll now be working on making it do kqueue() if it's available. Should be fairly simple to make that work, and then I'll be able to test my code on OSX that much easier.