ä»ä½ã£ã¦ãããã®ã§ããforkããå¾ãåããã»ã¹ã®å®è¡ã®çµæãæå¾ã«è¦ªããã»ã¹ã«éç¥ãã親ããã»ã¹ã¯åããã»ã¹ç¾¤ã®ç¶æ ãã¾ã¨ãã¦åå¾ããããã¨ãããã¨ãããããã®ã§ãããã¢ãã³ãã¤ç°¡åãªæ¹æ³ã£ã¦ä½ããããã§ããããï¼ å ·ä½çã«ã¯ use Parallel::ForkManager; $pm = Parallel::ForkManager->new(5); foreach $data (@all_data) { # Forks and returns the pid for the child: my $pid = $pm->start and next; # ... do some work with $data in the child process ... # å®è¡çµæã®ãµããªã¼ã親ããã»ã¹ã«æãã¦ãã $pm->finish; # Terminates the child proc
{{#tags}}- {{label}}
{{/tags}}