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

XS: MY_CXT vs PL_modglobal?

Thread Next
From:
Shmuel Fomberg
Date:
October 27, 2008 13:54
Subject:
XS: MY_CXT vs PL_modglobal?
Message ID:
49062A70.4090203@012.net.il
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.

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About