Results 1 to 3 of 3
Thread: how to run parallel processes ?
- 03-01-2011, 09:32 PM #1
Member
- Join Date
- Mar 2011
- Posts
- 3
- Rep Power
- 0
how to run parallel processes ?
Hi,
My use case is to split a huge gz file into multiple files and then run another java code in parallel on these multiple files and exit the main program when these all child programs finish.
My question is
how can I do it in java ?:
i) what is best way to split a huge file (20-30 GB) into smaller chunks ?
ii) what is best way to run lot of parallel processes from a java program, where all processes do the same thing and main process should exit when these processes finish.
iii) Also, is it possible for main program to get exception if any of the child fails and it can re-submit this child again after correcting error condition .
Thanks,
-JJ
- 03-01-2011, 10:59 PM #2
- Join Date
- Jan 2011
- Location
- Richmond, Virginia
- Posts
- 3,069
- Blog Entries
- 3
- Rep Power
- 7
This is probably going to be quite challenging if you are not fairly experienced with java. But I would imagine you are looking for threads to run multiple processes, unfortunately, there is not much else I can add.
- 03-02-2011, 12:45 AM #3
Moderator
- Join Date
- Jul 2010
- Location
- California
- Posts
- 1,609
- Rep Power
- 5
ii) See Lesson: Concurrency (The Java™ Tutorials > Essential Classes) for how to create threads, which will allow you to do things in parallel.
i)As for 'the best way' of splitting a file, this depends upon what you wish to split on (delim, regex, etc...?)
iii) Create a listener (or many listeners) that are called upon when something bad happens.
None of the above is extremely trivial for a newcomer to the language (you don't mention your experience so I'm throwing this out there just in case)
Similar Threads
-
two parallel arrays
By Adomini in forum New To JavaReplies: 12Last Post: 09-07-2010, 01:45 AM -
Too many java.exe processes due to netbeans
By abhishek.jain in forum NetBeansReplies: 7Last Post: 12-29-2009, 01:52 PM -
GUI not killing processes when X is used to exit
By TimHuey in forum NetBeansReplies: 22Last Post: 09-06-2009, 05:21 PM -
Halt applet processes.
By barusk in forum Java AppletsReplies: 1Last Post: 04-06-2009, 05:11 PM -
netbeans processes don´t die
By karlen in forum NetBeansReplies: 0Last Post: 06-11-2007, 09:55 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks