[Israel.pm] Multi Threading exercises ideas

Shlomi Fish shlomif at iglu.org.il
Wed Aug 23 02:15:23 PDT 2006

On Wednesday 23 August 2006 08:25, Yossi.Itzkovich at ecitele.com wrote:
> Hi,
> I have never written a MT code (not in Perl nor in any other language I
> work with), and I would like to start exercise.
> Can you give me ideas (or links to ideas) for smalll MT application to
> write  ?  I want to write small application to "feel" the MT issue
> (==problems, deadlocks etc.)

One good problem is a First-Come First-Served Readers/Writers Lock:


Others I can think of are servers (such as web-servers) powered by thread 
pools. You might also wish to look at:


But there are plenty of other problems.

> BTW: Any known problems with MT in perl >=5.8.4 ?

Well, there are two alternative thread systems in perl5:

1. perl5005threads.
2. ithreads

perl5005threads is hod you'd normally expect thread to behave. ithreads are 
threads that are not quite lightweight because they keep copies of all 
non-shared variables. And even in the variables that are declared shared, 
there are many problems. (Last time I checked splice() was not supported on 
shared arrays.)

However, perl5005threads caused a lot of implementation problems for some 


	Shlomi Fish

Shlomi Fish      shlomif at iglu.org.il
Homepage:        http://www.shlomifish.org/

Chuck Norris wrote a complete Perl 6 implementation in a day but then
destroyed all evidence with his bare hands, so no one will know his secrets.

More information about the Perl mailing list