2024/06/22
-
Java Virtual Thread (3), executorService 생성프로그래밍/Java 2024. 6. 22. 21:41
Executor Service플랫폼 스레드에서 executorService를 실행해보자. @Slf4jpublic class VirtualThreadExecutorCreation { private static final Runnable runnable = new Runnable() { @Override public void run() { log.info("1) run. thread: {}", Thread.currentThread()); try { Thread.sleep(1000); } catch (InterruptedException e) { throw new Ru..
-
Java Virtual Thread (2), Thread와 Virtual Thread프로그래밍/Java 2024. 6. 22. 19:35
Thread@Slf4jpublic class Main { private static final Runnable runnable = new Runnable() { @Override public void run() { log.info("1) run. thread: {}", Thread.currentThread()); try { Thread.sleep(1000); } catch (InterruptedException e) { throw new RuntimeException(e); } log.info("2) run. thread: ..