develooper Front page | perl.ithreads | Postings from October 2008

XS: MY_CXT vs PL_modglobal?

Thread Next
Shmuel Fomberg
October 27, 2008 13:54
XS: MY_CXT vs PL_modglobal?
Message ID:
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.


Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About