Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

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

by run4flat (Initiate)
on Feb 17, 2012 at 15:02 UTC ( [id://954544]=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://954544]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (5)
As of 2024-04-18 18:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found