Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: XS/C, threads, and calling call_sv() with a code ref

by NERDVANA (Novice)
on Jul 11, 2018 at 05:04 UTC ( #1218274=note: print w/replies, xml ) Need Help??


in reply to XS/C, threads, and calling call_sv() with a code ref

If you *want* a threaded perl experience, then go with the earlier answers. But if all you really wanted was event-driven callbacks, you could have the C thread just write a byte into a pipe (which you're holding both ends of), then have the main perl interpreter read from the pipe and dispatch to callbacks right from perl-space, in a single-threaded manner. You can use something like select() or AnyEvent to wait for data to arrive on the pipe.

  • Comment on Re: XS/C, threads, and calling call_sv() with a code ref

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (5)
As of 2019-09-16 16:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    The room is dark, and your next move is ...












    Results (196 votes). Check out past polls.

    Notices?