Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
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 the fog begins to lift...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (4)
As of 2018-01-18 05:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How did you see in the new year?










    Results (206 votes). Check out past polls.

    Notices?