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.
|
|---|