Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Multi tasking with same data

by chennaiite (Sexton)
on Dec 16, 2006 at 13:02 UTC ( #590200=perlquestion: print w/replies, xml ) Need Help??
chennaiite has asked for the wisdom of the Perl Monks concerning the following question:

Hi monks,

I need to open a multiple cmd prompt window and have to run the same perl program.
All the program will be using the same data. Only the input parameter will differ. I do not know we could use threading for this.Also I never tried threading in perl before, But I can try if anybody helps me.

I would greatly appreciate if anyone provide some guidance.

Thanks...

Replies are listed 'Best First'.
Re: Multi tasking with same data
by zentara (Archbishop) on Dec 16, 2006 at 13:21 UTC
    Threading is only useful if you need to share realtime results between threads. If one thread dosn't care about how the other is running, you are better off using fork. See Parallel::ForkManager

    I'm not really a human, but I play one on earth. Cogito ergo sum a bum
Re: Multi tasking with same data
by jettero (Monsignor) on Dec 16, 2006 at 13:16 UTC

    Threading may be overkill. Perl implements a nice fork() even in windows.

    for (@ARGV) { if( -f $_ ) { unless( fork ) { system($cmdname, $_) == 0 or die; } } }

    I suspect you mean something other than the above, but it's hard to tell. Perhaps look at DB_File? Elaborate on the problem and my answer is likely to change significantly.

    -Paul

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://590200]
Approved by Corion
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (6)
As of 2016-12-04 12:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (64 votes). Check out past polls.