I think it'd be a good idea formally to document/expose
threads::shared::_refcnt, though perhaps without the leading
underscore.

When DESTROYing a share()d (and typically XS-backed) object that
represents some underlying system resource, one wants to
release/free/close/dismiss the system resource only on the final
DESTROY, regardless of thread.  Perl's filehandles under ithreads
already behave like this without share()ing, but this behavior is
difficult to emulate with user-defined objects.  ( See also
http://perlmonks.org/?node_id=632731 )

Of course, one can do this sort of bookkeeping one's self, but, AFAIK,
threads::shared is already doing the bookkeeping with _refcnt.

Anyone have comments or a better way?

Regards,
Mike
--
cat: .signature: Inode is remote (not really error)

Reply via email to