in reply to Re: Capturing XS printf output with a tied filehandle (lots)
in thread Capturing XS printf output with a tied filehandle

Yeah, providing functions say() and sayf() for Inline and/or XS users are probably the simplest. Not entirely trivial, but it shouldn't be much more difficult than instructing the user to retrieve a function pointer from a Perl stash and then call it with their args.

As for your ideas about using threads, yes, that would certainly make life a lot easier. However, Prima is not (yet?) threadsafe. I really like Prima's internals, though, and I may help Dmitry work on it if he's interested.

Thanks!

  • Comment on Re^2: Capturing XS printf output with a tied filehandle (lots)

Replies are listed 'Best First'.
Re^3: Capturing XS printf output with a tied filehandle (lots)
by Anonymous Monk on Feb 18, 2012 at 00:26 UTC

      Yes, Prima is wonderful, and I've managed to keep most of my long-winded calculations finely grained enough that I can maintain responsiveness. However, tye's suggestion that I run one widget in its own thread the rest of the application in a different thread will not work with Prima, as the documentation that you link suggests. And that bit is something that I would really like to push if I find spare tuits some time this summer or fall.

        However, tye's suggestion that I run one widget in its own thread the rest of the application in a different thread will not work with Prima, as the documentation that you link suggests.

        tye suggested you do what works, which is only run prima in a child thread, and communicate through pipe/sockets, the same thing prima faq suggests