Operating System - HP-UX
1753905 Members
10042 Online
108810 Solutions
New Discussion

how can i use mutilthreading in perl . please can u take simple example and explain it

 
kiran1977
Occasional Contributor

how can i use mutilthreading in perl . please can u take simple example and explain it

Great Thanks
1 REPLY 1
Indira Aramandla
Honored Contributor

Re: how can i use mutilthreading in perl . please can u take simple example and explain it

Hi,

The Thread module provides multithreading support for perl. new starts a new thread of execution in the referenced subroutine. The optional list is passed as parameters to the subroutine. Execution continues in both the subroutine and the code after the new call. new Thread returns a thread object representing the newly created thread.

Here is something as an example from the web.

Explore the multithreaded capabilities of Perl while building a LAMP Web crawler with all the necessary components of a basic search engine. by Brian Carr and Tim Cambier

This article presents a Perl application for which using multithreading capabilities makes sense: a Web crawler with all the necessary components of a basic search engine. The downloadable code includes the MySQL database creation scripts, Perl code, and PHP interface files.

The application requirements for the example are:
All open source
Small footprint
Ability to score content
Multithreaded application

To exemplify the point of a small footprint, the crawler, search engine, and database run on a very old Pentium 166MHz with 32MB RAM

Attached is the downloaded code.

I hope this helps you.


IA
Never give up, Keep Trying