> I want to accomplish following task with fork function. But i am not > sure this can be done with fork()? > > I have a lengthy Perl script running on a 4 processor machine. At one > point of time i have to execute four shell commands / mysql quries from > four different batch files. Currently i run them one after other. Can i > use fork at this place so that i can fire all 4 mysql quries > simultaneously and collect the results back to main process.
from what I understand....forking would only release a single process and your processors would need to time slice between the current process and the forked process.... but I will assume that you want all the four tasks to run simeltaneously on different processors for this you would have to use parallel C or anything similar > > portion of script follows ... > #!/usr/bin/perl > ............. > ........... > $var1=`mysql -h localhost -u xx -pyy filter < batchfile1.sql |tail -1`; > $var2=`mysql -h localhost -u xx -pyy filter < batchfile2.sql |tail -1`; > $var3=`mysql -h localhost -u xx -pyy filter < batchfile3.sql |tail -1`; > $var4=`mysql -h localhost -u xx -pyy filter < batchfile4.sql |tail -1`; > > $total=$var1+$var2+$var3+$var4; > > NOTE : I dont want to use Perl-DBI. > > Many thanks in advance.... > -- > Ra. Gowthaman, > Graduate Student, > Bioinformatics Lab, > Malaria Research Group, > ICGEB , New Delhi. > INDIA > > Phone: 91-9811261804 > 91-11-26173184; 91-11-26189360 #extn 314 > > ------------------------------------------------------- > This SF.Net email is sponsored by BEA Weblogic Workshop > FREE Java Enterprise J2EE developer tools! > Get your free copy of BEA WebLogic Workshop 8.1 today. > http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click > _______________________________________________ > linux-india-help mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/linux-india-help > ------------------------------------------------------- This SF.Net email is sponsored by BEA Weblogic Workshop FREE Java Enterprise J2EE developer tools! Get your free copy of BEA WebLogic Workshop 8.1 today. http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click _______________________________________________ linux-india-help mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/linux-india-help
