2007年6月9日 星期六

Parallel::ForkManager

在 Perl 裡面如何把這種程式平行化? 假設每次 interation 是獨立的。

foreach $data (@all_data) {
eat_cpu($data);
}



超簡單



use Parallel::ForkManager; # !!
$pm = new Parallel::ForkManager($MAX_PROCESSES);


foreach $data (@all_data) {
$pid = $pm->start and next;
eat_cpu($data);
$pm->finish;
}

7 則留言:

casinositetop 提到...

Type of fantastic informative web site, Awesome! Thanks
바카라사이트
카지노사이트
온라인카지노
바카라사이트닷컴

betmantoto18 提到...

Great & nice articles with a lot of information to read. 토토사이트

safecasinosite18 提到...

I finally found what I was looking for! I'm so happy. 카지노사이트

safetotosite18 提到...

Your article is what I've been looking for for a long time. I'm happy to find you like this. 먹튀검증

casinositeone.JDS 提到...

I got so involved in this material that I couldn't stop reading. I am impressed with your work and skill. Thank you so much. 카지노사이트존
카지노사이트
바카라사이트

casinosite777info.JDS 提到...

Excellent blog you have got here.. It’s hard to find quality writing like yours nowadays . 카지노사이트
바카라사이트
온라인카지노

casinositezone.JDS 提到...

I really appreciate individuals like you! Take care!!
카지노사이트원
카지노사이트
바카라사이트