fd passing
Today's goal was to learn how file descriptor passing works in Unix.
I couldn't find a Perl module to do it so I set off writing it in C, with the hope to understand it well enough to implement it in Perl. So I wrote it in C, got it working, and started to implement it in Perl, quickly finding:
http://search.cpan.org/~addi/File-FDpasser-0.09/FDpasser.pm
... which is exactly what I need. And reasonably portable. The act of writing it in C just led me down the road of knowing the right keywords to look for (namely "sendmsg"), which made me find this module, which led me to FDpasser.
The next goal is ripping out all the non-portable Linux::AIO code in Perlbal to instead do sync operations in child threads using fd passing.
I couldn't find a Perl module to do it so I set off writing it in C, with the hope to understand it well enough to implement it in Perl. So I wrote it in C, got it working, and started to implement it in Perl, quickly finding:
http://search.cpan.org/~addi/File-FDpasser-0.09/FDpasser.pm
... which is exactly what I need. And reasonably portable. The act of writing it in C just led me down the road of knowing the right keywords to look for (namely "sendmsg"), which made me find this module, which led me to FDpasser.
The next goal is ripping out all the non-portable Linux::AIO code in Perlbal to instead do sync operations in child threads using fd passing.