java模拟多线程

 public class HTTPRequest  implements Runnable {

      public void run() {

       //这里实现发送请求

}

 

  public static void main(String[] args) {

  ExecutorService service = Executors.newFixedThreadPool(50);

  for (int i = 0; i < 50; i++)

     service.execute(new HTTPRequest ());//并发50个用户

     

}

}

posted on 2018-04-17 16:52  XZhe  阅读(303)  评论(0编辑  收藏  举报