# ThreadPoolExecutor java 에서 멀티스레드 프로그램을 구현시 자바 1.5 에 추가된 concurrent 패키지를 많이 이용하게 된다. concurrent 패키지에 있는 ThreadPoolExecutor 는 Thread 를 직접 생성하고, 관리하는 부분을 추상화하여 작업(task)과 실행(execute)을 분리시켜준다. ThreadPoolExecutor 는 Executors 에 있는 팩토리 메서드를 이용해 간편하게 생성할 수도 있고, 직접 생성자를 호출해서 객체를 생성할 수도 있다. Executors.newCachedThreadPool(); Executors.newFixedThreadPool(10); Executors.newSingleThreadExecutor(); Executors.n..
자바에는 UncaughtExceptionHandler 라는 인터페이스가 있다. 생소한 인터페이스일텐데 jdk 1.5 에 추가된 인터페이스이다. Thread 클래스의 내부 인터페이스로 선언되어있는데, 위치만 봐도 알 수 있듯이 쓰레드에 관련한 인터페이스이다. 쓰레드가 동작할때 내부에서 발생한 예외를 처리하지 않을 경우 UncaughtExceptionHandler 인터페이스의 구현체에서 예외를 처리할 수 있다. @FunctionalInterface public interface UncaughtExceptionHandler { /** * Method invoked when the given thread terminates due to the * given uncaught exception. * Any exce..
- Total
- Today
- Yesterday
- JavaScript Core
- TEST
- toby
- backend개발환경
- DesignPattern
- Kotlin
- servlet
- code
- frontcode
- java
- generics
- http
- 정규표현식
- programming
- OOP
- Spring
- JPA
- Jackson
- spring cloud
- db
- frontend개발환경
- go-core
- Git
- Design Pattern
- EffectiveJava
- MySQL
- java8
- clean code
- mariadb
- javascript
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |