Use sysread and syswrite. Really.
In reply to Re (tilly) 2: Non blocking read on a filehandle by tilly in thread Non blocking read on a filehandle by odie