Runtime.getRuntime().e x e c("...cmd..."); 实际调用: ----------------------------------- return new ProcessBuilder(cmdarray) .environment(envp) .directory(dir) .start(); 实际调用: ----------------------------------- return ProcessImpl.start(cmdarray, environment, dir, redirects, redirectErrorStream); 实际调用: ----------------------------------- private static synchronized native long create(String cmdstr, String envblock, String dir, long[] stdHandles, boolean redirectErrorStream) throws IOException; ----------------------------------- create是同步方法。 如果多个进程,同时执行cmd,那么create时需要挨个等待……
|