develooper Front page | perl.ithreads | Postings from February 2008

Re: Passing an IO:Handle to a Thread

Thread Previous | Thread Next
From:
Dean Arnold
Date:
February 29, 2008 16:15
Subject:
Re: Passing an IO:Handle to a Thread
Message ID:
47C8A019.8030508@presicient.com
Dave Mitchell wrote:
> On Wed, Feb 27, 2008 at 08:15:36AM -0800, Dean Arnold wrote:
>> As to shared object destruction:
>>
>> pre-5.10.0: once per thread, requires some extra bookkeeping to make sure
>> it "does the right thing"
>>
>> 5.10.0: once in the last referencing thread (fixed in CORE)
> 
> Huh?
> 
>     use warnings;
>     use strict;
> 
>     use threads;
>     use threads::shared;
> 
>     sub DESTROY { warn "DESTROY $_[0]\n" }
> 
>     my $h = bless {};
>     share $h;
>     threads->new(sub {})->join;
> 
> $ perl5100t /tmp/p
> DESTROY main=HASH(0x98fb844)
> DESTROY main=HASH(0x98748c4)
> $ 
> 
> 

Hmmm, it looks like the PL_destroyhook change in CORE
made it into 5.10.0, but the version of threads::shared
that uses it didn't. It looks like the CPAN version has
it...or am I missing something else ?

Dean Arnold

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About