[ Java.Thread-1. Thread Method 목록 ]
1. 정의
- 쓰레드 관련 Class와 Method목록을 기술하고
이 목록을 기준으로 각각 설명 및 예제를 작성해서 게시한다.
2. Extends, Implements Class
- Extends : Thread
- Implements : Runnable
3. 기능 Class
- ExecutorService : Thread Pool 기능을 사용
4. Class별 메소드
1. Thread
getName() |
thread name 얻기 | |
Thread.currentThread().getName() |
thread name 얻기 | |
setName() |
thread name 정의 (setting) | |
Thread.sleep() |
thread를 일정시간 pause 시킴 | |
|
|
2. Runnable
|
|
|
|
|
|
|
|
|
3. ExecutorService
|
newFixedThreadPool() |
Thread Pool 개수 지정 |
|
newCachedThreadPool() |
쓰레드 수의 제한을 두지 않은 방식의 쓰레드풀 방식으로, 새로운 쓰레드 시작 요청이 들어올때마다 하나씩 쓰레드를 생성 |
|
newSingleThreadExecutor() |
단하나의 쓰레드를 생성 |
|
newScheduledThreadPool() |
일정시간마다 주기적으로 반복해야 하는 스타일의 동시작업을 위한 쓰레드풀. Timer 클래스를 대체할수 있는 쓰레드 풀방식이다. |
ForkJoinPool() |
큰 업무에 대해 분할정복과 CPU최대이용방식을 적용한 독특한 쓰레드 풀이다. |
'자바(java) > Socket(TCP-IP)통신' 카테고리의 다른 글
Java.Thread-4. Thread Pool-2 (예제) (0) | 2017.02.16 |
---|---|
Java.Thread-4. Thread Pool-1 (기본개념) (0) | 2017.02.16 |
Java.Thread-3. Thread예제-3 (쓰레드 이름) (0) | 2017.02.16 |
Java.Thread-3. Thread예제-2 (쓰레드 이름) (0) | 2017.02.16 |
Java.Thread-3. Thread예제-1 (기초) (0) | 2017.02.16 |