Gossamer Forum
Home : General : Perl Programming :

Forking & Threads

Quote Reply
Forking & Threads
Hello all! Right now I'm learning how to use threads and forks. First off, threads are still in beta and my server doesn't allow me to use threads for multi-tasking. So now, I really gotta use forking for a project I'm working on. Right now, a script that I developed will submit to search engines in one process through a foreach loop on a array with the search engine urls. What I'm trying to figure out is how can fork each search engine as individual process so I can get faster submission. I've experimented, but all I can get is the entire script running a zillion times simutaneously, so it submits a url zillion times to a search engine. I don't need code, but just an idea of how to get around this have each engine submission process individual. . .

------------------
http://www.techdevelopers.com
ASP, HTML, CGI, Flash, and more!

HPCalc.com - English
Official HP Calculator Site
http://www.hpcalc.com/english

Quote Reply
Re: Forking & Threads In reply to
 
http://www.perl.com/...tml/pod/perlipc.html

You can communicate between your forks to allow a global counter of sorts to avoid having multiple processes running the same query.
-- Gordon --


------------------
$blah='82:84:70:77';
print chr($_) foreach (split/:/,$blah);

Quote Reply
Re: Forking & Threads In reply to
can't you just use Parallel or something? this is LWP we're talking about right?

jerry
Quote Reply
Re: Forking & Threads In reply to
Well, I got it to work with forks now. The problem that I have with LWP is that people complain to much to me about their ISP not having LWP so I'm trying to recode and add extra features without the use of any other modules that is not included in the standard PERL set. . .