Your skill will accomplish what the force of many cannot |
|
PerlMonks |
Re: Use more than one threads for one file processingby marioroy (Prior) |
on Jun 17, 2016 at 23:53 UTC ( [id://1166012]=note: print w/replies, xml ) | Need Help?? |
Hi heavenfeel, The following is a demonstration using the MCE::Loop module. What is nice about MCE is the ability to process a file containing multiple records. The record separator for a fastq file is "\n@" which anchors @ at the start of the line. MCE detects "\n" at the start of the record separator. MCE is a chunking engine allowing a worker to receive several records at a time. The effect is a reduction in the number of trips to and from the MCE-manager process. The logic below allows one to search multiple patterns. Simply change the patterns to suite your needs. Perhaps, this can read patterns stored in a file. Anyway, this is a small MCE demonstration. The MCE->print statement prints the entire record to STDOUT. Kind regards, Mario
In Section
Seekers of Perl Wisdom
|
|