develooper Front page | perl.ithreads | Postings from July 2011

Re: Load modules in Perl at run time and share it between threads -Stack Overflow Question

Thread Previous
From:
Dave Mitchell
Date:
July 2, 2011 01:19
Subject:
Re: Load modules in Perl at run time and share it between threads -Stack Overflow Question
Message ID:
20110702081938.GB2747@iabyn.com
On Sat, Jul 02, 2011 at 03:45:39AM +0100, Pedro Cirne wrote:
> Is it possible to load modules at run time, require '/file_path/file_name.pm
> ;' , and share the memory between threads?
> 
> Basically, I have a pool of threads, if thread#1 decides to load a module, I
> want the module available to all the threads!
> http://stackoverflow.com/q/6553598/758523

No, it's not possible.
Either the module must be loaded before the thread is created, or each
thread must individually load the module.

-- 
More than any other time in history, mankind faces a crossroads. One path
leads to despair and utter hopelessness. The other, to total extinction.
Let us pray we have the wisdom to choose correctly.
    -- Woody Allen

Thread Previous


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