[Israel.pm] module threads?
semuelf at 012.net.il
Sun Aug 26 13:58:45 PDT 2007
I did some reading about threads modules in CPAN, and some interesting
things that I found:
Thread::Tie - A module that is proof-of-concept, for replacing shared
variable with other architecture. The most interesting thing in that
module is that it create a "mother thread" as soon as possible, (for
minimum memory waste) and duplicate it when it needs threads.
Thread::Isolate - Create a thread, where you can eval command into. Only
good if you have some task that you needed done that loads a lot of
modules, and all these modules will be useless a second later.
Thread::Use - for people who does not know about require and import?!
Thread::Queue::Duplex - can act as a simple communication channel
(two-directional) between threads.
Thread::Queue::Multiplex - does the same as above, just as one-to-many
Thread::Needs - I think that this is the module that I was looking for.
It makes Perl clone to a new thread only a specific list of modules.
Possible problems can arise when few modules are opening threads. Also
the whole process is dangerous, but that's OK. :-)
Thread::Conveyor - moving data between threads - worth the reading.
And for the final - forks. A drop-in replacement for 'threads' that does
everything that threads does, just with forking the process instead of
playing with the interpreter. The writer claim that by relaying on the
OS's copy-on-write mechanism, his way saves memory better then threads.
Btw, who is Elizabeth Mattijsen? She wrote lot of modules about threads.
>From: perl-bounces at perl.org.il [mailto:perl-bounces at perl.org.il] On
>Of Shmuel Fomberg
>Sent: Friday, August 24, 2007 5:45 PM
>To: perl at perl.org.il
>Subject: [Israel.pm] module threads?
>I though about something, and want your opinion.
>Most of the threads that I've seen until now do not "exit" from the
>file where they were created.
>So I though that it will be interesting to have "module threads", that
>instead of duplicating the Perl interpreter, just clone the file that
>the thread is created in. then, is the thread need any other modules,
>can require them.
>Whet do you think?
>I looked on the code, and it will be hell to implement. (well,
>implementing will be easy. To understand what is going on there is...
>Perl mailing list
>Perl at perl.org.il
>No virus found in this incoming message.
>Checked by AVG Free Edition.
>Version: 7.5.484 / Virus Database: 269.12.4/969 - Release Date:
More information about the Perl