In my application I kick off a batch file that runs osql commands and executes scripts for our dbas. There are some scripts that I can run in parallel and so I am now creating threads to run those. However I still see a serialized execution of threads one after another.
Is this even possible to kick off processes (using Runtime.exec) in a thread run() method and expect it to run concurrently?? Would my running process be blocking the parent process and so the sibling threads for running at all??
How can I achieve what I am looking for..
Joined: Mar 07, 2003
I found the issue. The code was just not going in right block that would kick off threads but would go in the serialized block.(as I have support for both modes). With that fixed the processes do INDEED run in parallel, kicked off from threads..wonderful
the exec() method is asynchronous by itself. If you just start a bunch of them they'll run in parallel. Do you waitFor() to know when they're done? That would make you wait until one finishes before starting the next.
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi