Hi, Not sure if this helps or not: Are the contexts across threads? Are the contexts using a different instance of the interpreter that created the SV's? If the answer is yes to either, then you will have problems. I use a similar design approach in one of my apps (the contexts are running in different threads and interpreters) and the only way I could get this working was to serialize the data before sending it over (I used storable to serialize , which I call from XS). The contexts are connected together with C based event queues. I was using an old version of Perl, so perhaps things have changed... Regards,
Date: Tue, 22 Jul 2014 10:17:28 +0200 From: tristan.darri...@inria.fr To: perl-xs@perl.org Subject: How to use sv_dup_inc() ? Hi, I am working on a XS module in which I have to transmit and share data between multiples contexts. To simplify, this system is constructed around two methods: - send(<name>, <data>) - receive(<name>) : <data> Send and receive are called from two different contexts and the destination context can't be known in advance. (I have the insurance that the data will be used in the destination context before the destruction of the sender context). In my initial code I have some problems of double free during the destruction of the contexts (panic: free from wrong pool). I think that I have to use sv_dup_inc() to solve this issue but I may have miss something because I get a Seg. fault in S_ptr_table_find (tbl=0x0, sv=0xa0b5a8) at sv.c:12197 So could you help me to find how to use sv_dup_inc() correctly? Thanks! Tristan