![](/img/trans.png)
[英]How to work concurrently two different threads which have the same priority?
[英]Can Java understand that threads which have same name are different threads?
在每次迭代中,創建一個線程“student”。 因為這些線程都被命名為“學生”。 Java可以理解這些是不同的線程嗎?
while (true) {
System.out.println("Waiting for client...");
// open client socket to accept connection
client = server.accept();
System.out.println(client.getInetAddress()+" contacted ");
System.out.println("Creating thread to serve request");
ServerStudentThread student = new ServerStudentThread(client);
student.start();
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.