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

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

From:
Rafael Garcia-Suarez
Date:
July 30, 2002 00:41
Subject:
Re: Thread::Use - use a module inside a thread only
Message ID:
3D4641E7.1060308@hexaflux.com
Elizabeth Mattijsen wrote:
> 
> Thread::Use - use a module inside a thread only
> 
> =head1 SYNOPSIS
> 
>     use Thread::Use;
> 
>     threads->new( sub {
>      useit Module;
>      useit Module qw(parameters);
> 
>      noit Module;
>      noit Module qw(parameters);
>     } );

OK, I looked a bit at this, and I must confess that I don't
understand how/why it works.

Looks like stashes are not shared between threads. How
is this related to saving memory ? (for modules that don't
export lots of symbols into the caller's namespace).
Does the module gets unloaded in some way when the thread
ends ?

(BTW your module doesn't provide an interface equivalent to
	use Foo ();
	no Bar ();
--that doesn't call import().)




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