Need help on Threads to add parallelism.

Need help on Threads to add parallelism.

am 05.11.2008 11:36:18 von Ningappa Sullalli

Hello all,
I have an perl script download.pl, which downloads the some application builds for different platforms(ex: AIX,HP-UX,Solaris,Linux, and Windows) from build server(ABC) to local build server(XYZ). The script download.pl runs on local build server(XYZ), takes the inputs from file (containing the build details) and connects to build server(ABC) through ftp and download the builds for each OS/platforms. It will download individual builds one by one for each OS/platform and taking huge time (almost half a day). Now I want to use Threads feature of the perl to add parallelism to the script so that it will create multiple thread and start downloading builds for all os/platform simultaneously. If you could help me to achieve this using Theads::Pool module or some other way, it would be great help.


Thanks & Regards,
Nings

________________________________
This message (including attachment if any) is confidential and may be privileged. If you have received this message by mistake please notify the sender by return e-mail and delete this message from your system. Any unauthorized use or dissemination of this message in whole or in part is strictly prohibited. E-mail may contain viruses. Before opening attachments please check them for viruses and defects. While MindTree Limited (MindTree) has put in place checks to minimize the risks, MindTree will not be responsible for any viruses or defects or any forwarded attachments emanating either from within MindTree or outside.

Please note that e-mails are susceptible to change and MindTree shall not be liable for any improper, untimely or incomplete transmission.

MindTree reserves the right to monitor and review the content of all messages sent to or from MindTree e-mail address. Messages sent to or from this e-mail address may be stored on the MindTree e-mail system or else where.
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Re: Need help on Threads to add parallelism.

am 05.11.2008 12:59:33 von p sena

Hi,

Instead use fork if your r running unix's, well see how it would work on windows (i think there is a way for fork in active perl too). Threads would not be stable enough but yeah fast.
Group the tasks in some dstruct and the for each elem in the dstruct fork out processes and let the parent wait for the child pid's.
Seggregate out things/resources which appear to be accessed common between running parallel processes, this will help avoid race conditions during program run.
Cpan also has Parallel::ForkManager.

Regards & Thanks Prabir Senapati mailto: senapati2001@yahoo.com


--- On Wed, 11/5/08, Ningappa Sullalli wrote:

> From: Ningappa Sullalli
> Subject: Need help on Threads to add parallelism.
> To: "activeperl@listserv.ActiveState.com"
> Date: Wednesday, November 5, 2008, 4:06 PM
> Hello all,
> I have an perl script download.pl, which downloads the some
> application builds for different platforms(ex:
> AIX,HP-UX,Solaris,Linux, and Windows) from build server(ABC)
> to local build server(XYZ). The script download.pl runs on
> local build server(XYZ), takes the inputs from file
> (containing the build details) and connects to build
> server(ABC) through ftp and download the builds for each
> OS/platforms. It will download individual builds one by one
> for each OS/platform and taking huge time (almost half a
> day). Now I want to use Threads feature of the perl to add
> parallelism to the script so that it will create multiple
> thread and start downloading builds for all os/platform
> simultaneously. If you could help me to achieve this using
> Theads::Pool module or some other way, it would be great
> help.
>
> Thanks & Regards,
> Nings
>
> ________________________________
> This message (including attachment if any) is confidential
> and may be privileged. If you have received this message by
> mistake please notify the sender by return e-mail and delete
> this message from your system. Any unauthorized use or
> dissemination of this message in whole or in part is
> strictly prohibited. E-mail may contain viruses. Before
> opening attachments please check them for viruses and
> defects. While MindTree Limited (MindTree) has put in place
> checks to minimize the risks, MindTree will not be
> responsible for any viruses or defects or any forwarded
> attachments emanating either from within MindTree or
> outside.
>
> Please note that e-mails are susceptible to change and
> MindTree shall not be liable for any improper, untimely or
> incomplete transmission.
>
> MindTree reserves the right to monitor and review the
> content of all messages sent to or from MindTree e-mail
> address. Messages sent to or from this e-mail address may be
> stored on the MindTree e-mail system or else where.
> _______________________________________________
> ActivePerl mailing list
> ActivePerl@listserv.ActiveState.com
> To unsubscribe:
> http://listserv.ActiveState.com/mailman/mysubs




_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs