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;
}

10 則留言:

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!!
카지노사이트원
카지노사이트
바카라사이트

Robin 提到...

I am really enjoying the blog. I’m really impressed with your writing skills. Abogado Transito Spotsylvania VA

judasanjoy 提到...

Parallel::ForkManager is a Perl module that simplifies the management of parallel processes in Perl programs. It offers a simple API for creating and managing child processes, handling process synchronization and communication details. This makes it easier to write efficient and reliable parallel programs. Parallel::ForkManager can be used for web scraping, data processing, and network programming. An example is using it to scrape multiple web pages simultaneously, creating four child processes and waiting for them to finish before exiting the program. This powerful tool can improve performance, efficiency, and reliability in Perl programs that require multiple CPUs. estate litigation lawyer

madisson 提到...

The "Parallel::ForkManager" review offers valuable insights into a Perl module designed for parallel processing tasks. Through detailed analysis, it assesses the module's effectiveness in managing forked processes and optimizing resource utilization. The review may discuss its features, performance, and compatibility with different operating systems. It serves as a helpful resource for developers seeking efficient solutions for concurrent programming challenges. Overall, the "Parallel::ForkManager" review provides a comprehensive evaluation of its utility in facilitating parallel computing tasks within Perl applications. abogado de familia español