Take a look at Perl crash during perl_clone. Be warned, it is a long and complicated thread; read carefully. It will answer most of the questions in your OP.
Download the final version of the demo code I provided and play with it. See if you can see how to adapt it to a simplified version of your requirements.
Then come back if you have problems/questions.
In reply to Re: xs wrapper for a threaded library
by BrowserUk
in thread xs wrapper for a threaded library
by fng
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |