Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Multi-thread friendly object life-time handling for XS modules

by Anonymous Monk
on Nov 06, 2017 at 19:39 UTC ( #1202877=note: print w/replies, xml ) Need Help??


in reply to Multi-thread friendly object life-time handling for XS modules

You could probably fix it on the perl side by dropping a shared ref into the object and testing that in DESTROY.

my $OB = bless { piggy => shared_clone([]) }; my $T = async { }; say threads::shared::_refcnt($OB->{piggy}); $T->join; say threads::shared::_refcnt($OB->{piggy});

  • Comment on Re: Multi-thread friendly object life-time handling for XS modules
  • Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1202877]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (3)
As of 2018-07-21 12:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?















    Results (448 votes). Check out past polls.

    Notices?