XP is just a number | |
PerlMonks |
Re^3: Threads From Hell #3: Missing Some Basic Prerequisitesby marioroy (Prior) |
on Jun 02, 2015 at 04:21 UTC ( [id://1128702]=note: print w/replies, xml ) | Need Help?? |
Update: See this post for a faster version. A MCE + Inline::C demonstration is also included. Parallelism is possible with just one line of code for the next demonstration. As in the previous examples, am using the sequence generator with chunk_size set to 1. Thus, $_ is the next sequence number when specifying chunk_size => 1.
Folks will be pleased to know that this will work for non-threads in the upcoming MCE 1.7 release with MCE::Shared. One simply replaces ( use threads; use threads::shared ) with ( use MCE::Shared ) and ( my @picture : shared; ) with ( my @picture : Shared; ). That's all. The code outputs the image in pbm format.
In Section
Seekers of Perl Wisdom
|
|