MultiThread

A Pipeline MultiThreading Model
Download

MultiThread Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Publisher Name:
  • David Spadea
  • Publisher web site:
  • http://search.cpan.org/~dspadea/

MultiThread Tags


MultiThread Description

A Pipeline MultiThreading Model MultiThread is a Perl module that implements a Pipeline multithreading model. Several concurrent threads are started -- one for each subroutine in the pipeline. The subs and other MultiThread objects are daisy-chained together by queues. The output queue of one step in the pipeline is the input queue of the following step.In the contrived example above, add_one is run by a WorkerPool object, and the WorkerPool object is placed first in the pipeline. It takes the request and adds one to it, returning the result. The result of add_one is fed as a request directly into add_two, which adds two and returns the result. Because add_two is the final step in the chain, its output will be returned to the user via the get_response method.MultiThread::Pipeline is great when you have multiple steps that take different times to complete. MultiThread::Pipeline handles the inter-step queuing for you, so you don't need to worry about what happens when one step outruns another. Each step simply processes asynchronously as quickly as it can.One major consideration with MultiThread::Pipeline versus MultiThread::WorkerPool is that MultiThread::Pipeline starts one thread for every sub in the pipeline, without regard for the number of CPUs on the system. Requirements: · Perl


MultiThread Related Software