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

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

Thread Previous | Thread Next
Nick Ing-Simmons
July 31, 2002 09:16
Re: Thread::Use - use a module inside a thread only
Message ID:
Elizabeth Mattijsen <> 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...

Nick Ing-Simmons

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About