Test::MultiProcess

Run identical code in multiple fork'ed processes
Download

Test::MultiProcess Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Publisher Name:
  • Danny Brian
  • Publisher web site:
  • http://search.cpan.org/~dbrian/

Test::MultiProcess Tags


Test::MultiProcess Description

Run identical code in multiple fork'ed processes Test::MultiProcess is a Perl module that provides a single function, run_forked, which takes a coderef and a number of times to fork for the given code. The obvious use here is testing code that does something that could encounter problems while running simultaneously in multiple processes or threads: stress testing, concurreny testing, locking testing, and so on.Each forked processes runs the code provided. That code should return a string value. Returned values get written to a shared mmap cache, which are returned by the run_forked() function. The returned structure is a hashref with the string values as keys, and values representing the number of times the string was returned.See the tests in t/ for examples.Note that I don't necessary believe this is the ideal way to perform certain types of testing. This module is in no way thorough, but it does provide a simple way to run code in many processes simultaneously. And nothing more.SYNOPSIS use Test::MultiProcess; my $results = run_forked( code => sub { }, forks => 10 ); Requirements: · Perl


Test::MultiProcess Related Software