Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
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 cooling their heels in the Monastery: (4)
As of 2017-11-18 14:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:













    Results (277 votes). Check out past polls.

    Notices?