線程和並發
1.線程和並發的思維導圖:
----------------------------------------------------------------------------------------------------------------------------------------
2.並發和並行:
----------------------------------------------------------------------------------------------------------------------------------------
3.進程和線程:
----------------------------------------------------------------------------------------------------------------------------------------
4.多線程的優勢:
----------------------------------------------------------------------------------------------------------------------------------------
5.Java操作進程
1 public static void main(String[] args) throws IOException { 2 //Java中如何開啟一個進程 如記事本 3 //方式一:使用Runtime類的exec方法 4 Runtime rt = Runtime.getRuntime(); 5 rt.exec("notepad"); 6 //方式二:processBuilder的start方法 7 ProcessBuilder pb = new ProcessBuilder("notepad");8 pb.start(); 9 }
----------------------------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------------------------
線程和並發