-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathFixedThreadPool.java
More file actions
35 lines (32 loc) · 888 Bytes
/
FixedThreadPool.java
File metadata and controls
35 lines (32 loc) · 888 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/**
* <html>
* <body>
* <P> Copyright 1994 JsonInternational</p>
* <p> All rights reserved. - https://github.com/Jasonandy/Java-Core-Advanced </p>
* <p> Created by Jason</p>
* </body>
* </html>
*/
package cn.ucaner.core.concurrent;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
/**
* @Package:cn.ucaner.core.concurrent
* @ClassName:FixedThreadPool
* @Description: <p> FixedThreadPool </p>
* @Author: -
* @CreatTime:2018年6月12日 下午3:49:55
* @Modify By:
* @ModifyTime: 2018年6月12日
* @Modify marker:
* @version V1.0
*/
public class FixedThreadPool {
public static void main(String[] args) {
ExecutorService exec = Executors.newFixedThreadPool(5);
for (int i = 0; i < 5; i++) {
exec.execute(new LiftOff());
}
exec.shutdown();
}
}