XS: MY_CXT vs PL_modglobal?

[email protected] (Shmuel Fomberg) Mon, 27 Oct 2008 22:54:08 +0200
Newsgroups perl.ithreads
Message-ID <[email protected]>
Hi All.

A question about threads from the XS-embedding-module perspective:
What is the difference between MY_CXT and PL_modglobal?

I have implemented C running Perl module that embed a C XS function, and 
want to pass a pointer to that function from the C code that runs Perl.
The Perl side span multiple threads, and each call that C function.

Until now I used PL_modglobal, as I thought that it is per-interpreter 
hash that can be used safely from different threads. After a few 
crashes, I'm not so sure.

So, what is the difference between MY_CXT and PL_modglobal? not in the 
global scope that one have while the other is local, but from threads 
safety question.

Thanks,
Shmuel.