I just got into executing batch programs from Java. I was trying to make a converter program poll a directory so that the files would automatically be converted by ffmpeg and sent to an output directory. I wrote something along the lines of this...
Process p = Runtime.getRuntime().exec("ffmpeg args args args args....");
p.waitFor();
And this is how I would do something with a Thread
Thread threadThlinstone = new Thread(new Runnable()
{
@Override
public void run()
{
// Do thing!
}
}).start();
threadThlinstone.join();
Besides the fact that one creates a new JVM to execute the task, and instances of the JVM can share memory, is there anything fundamentally different between these two code examples?