develooper Front page | perl.perl5.porters | Postings from July 2002

Re: Thread::Use - use a module inside a thread only

Thread Previous | Thread Next
From:
Nick Ing-Simmons
Date:
July 31, 2002 09:16
Subject:
Re: Thread::Use - use a module inside a thread only
Message ID:
20020731161559.1301.10@bactrian.elixent.com
Elizabeth Mattijsen <liz@dijkmat.nl> writes:
>
>I think the simplest way would be to have PerlIO::gzip kill itself off 
>altogether when it is being cloned.  If you would like to have PerlIO::gzip 
>in the thread as well, you could simply C<useit> again.

You don't need to remove :gzip from the list of known layers,
just remove the layer from the streams.

>
>As I said, as a simple solution for now, I think a:
>
>   sub CLONE { undef( %PerlIO::gzip:: ) }

I don't think that helps any. That just means the layer stack now 
has pointers to things that are no longer in the symbol table.

What _needs_ to be done is the ->Dup entry of :gzip's vtable 
needs to not push itself on the child side (or pop itself on the 
parent side). Possibly "flush" the stream remove itself 
and then re-add both sides?

>
>or equivalent of that in XS code would be sufficient to get around the 
>current problem of having to start your threads before you can open a 
>PerlIO::gzip layer...




>
>
>Liz
-- 
Nick Ing-Simmons
http://www.ni-s.u-net.com/


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