in reply to Seg fault at dSP in Perl XS

You'll need to set the perl context when the callback is called. If you don't understand that, you have a somewhat steep learning curve ahead of you.

See the (long, twisted and deeply involved) thread at Perl crash during perl_clone that eventually resulted in a solution.

That last post contains a fairly complex demo where each of 4 Perl callbacks are called randomly and repeatedly from each of 4 (non-perl) threads.

Run it; try modifying it; ask questions; make sure you understand it before trying to apply it to more complex code. There are a lot of subtle details to it.


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

The start of some sanity?