Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
Dear Monks, I had a conversation with the developer of mpv. He confirmed that the wakeup callback can be called from any internal mpv thread (which mpv may create and destroy as it pleases). Because Scripting languages often cannot be called safely from foreign threads, it seems not really possible to implement set_wakeup_callback in perl. Instead he suggested that the callback (&callp()) just writes into a wakeup pipe. A similar solution I found on some perl specific posts, too: see for example the last answer of NERDVANA here, the answer of Eric Garland here and I think the Perl SDL bindings discussed also a such solution, see the old discussion here). Unfortunately in the SDL bindings I couldn't find whether they really implemented a pipe. Instead they use a perl_clone way, too. So my question: Could somebody tell me, how I can use a pipe to perl or a shared variable in a C thread, which I didn't created. Or does somebody know a example of a XS module which takes this approach? Thanks for all your help, Max

In reply to Re^5: XS callback to mpv_set_wakeup_callback by MaxPerl
in thread XS callback to mpv_set_wakeup_callback by MaxPerl

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (3)
As of 2024-04-18 23:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found