An alternative, perhaps uglier, approach is to share your objects and check threads::shared::_refcnt during DESTROYction.
POSIX::RT::Semaphore does this when run under threads, though a development branch did much the same CLONE counting as you detail above. It's all a lot of unfortunate bookkeeping, IMHO, to get the behavior exhibited by filehandles under threads, where the last dismissal in the last thread releases the underlying system resource.
In reply to Re: threads, refcounting, XS, DESTROY
by Anonymous Monk
in thread threads, refcounting, XS, DESTROY
by Joost
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |