in reply to Re: Inline C + IO::Handle
in thread FCGI + Inline::C fast stream out!

If someone else feels like tackling this, please go ahead, and let us know what you come up with :)

Your demo script works for me as is, if you change the XSub (my_print) to:
void my_print(SV * fh) { dSP; ENTER; SAVETMPS; PUSHMARK(SP); XPUSHs(sv_2mortal(fh)); XPUSHs(sv_2mortal(newSVpv("TEXT", 0))); PUTBACK; call_pv("MyFH::PRINT", G_DISCARD); FREETMPS; LEAVE; }
Update: Changed PUSHs(fh) to XPUSHs(sv_2mortal(fh)). (Still sems to do the required task.)

This can quite possibly be improved (there are a few things that I ought to check regarding sins that are perhaps being committed) ... but, given the convoluted nature of what it does, I'm not even sure that it's helpful.

Cheers,
Rob