Prty::Parallel - Führe eine Berechnung parallel aus
Prty::Object
Lasse 50 Prozesse für jeweils eine Sekunde schlafen. Die Ausführungsdauer beträgt ungefähr 50/ANZAHL_CPUS Sekunden, da immer ANZAHL_CPUS Prozesse parallel ausgefhrt werden.
$| = 1; Prty::Parallel->compute([1..50],sub { my ($elem,$i) = @_; sleep 1; return; });
$class->compute(\@elements,$sub,@opt);
Die Elemente, auf denen die Berechnung einzeln durchgeführt wird.
Die Subroutine, die für jedes Element in @elements ausgeführt wird.
Die maximale Anzahl parallel laufender Prozesse.
Zeige Fortschrittsanzeige an.
nichts
1.108
Frank Seitz, http://fseitz.de/
Copyright (C) 2017 Frank Seitz
This code is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Prty, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Prty
CPAN shell
perl -MCPAN -e shell install Prty
For more information on module installation, please visit the detailed CPAN module installation guide.