Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[20220417] Java8 Concurrency #254

Open
JuHyun419 opened this issue Apr 17, 2022 · 0 comments
Open

[20220417] Java8 Concurrency #254

JuHyun419 opened this issue Apr 17, 2022 · 0 comments
Labels

Comments

@JuHyun419
Copy link
Owner

자바의 Concurrent 프로그래밍

기존의 자바 멀티 스레드 프로그래밍

  • Thread, Runnable
    • 직접적으로 스레드를 멈추고(sleep), 깨우기(interrupt), 기다리기(join) 등으로 관리를 해야 함
    • 리턴 결과를 받을 수 없음
  • Executors
    • 고수준 Concurrency 프로그래밍
    • 스레드 생성, 관리, 작업처리 및 실행을 애플리케이션에서 분리
  • ForkJoin 프레임워크
    • ExecutorService의 구현체, 기본적으로 CompletableFuture로 작업 시 생성되는 스레드
  • Callable
    • Runnable와 비슷하나 작업의 결과를 받을 수 있음
  • Future
    • Callable와 마찬가지로 비동기적인 작업의 상태를 조회 및 결과를 가져올 수 있음(get())
    • get(): 블록킹
  • CompletableFuture
    • 비동기(Async)를 가능하게 해주는 자바의 인터페이스
    • Future를 implements
    • Future로 할 수 없던 작업들을 가능하게 해줌
      • TimeOut 설정
      • 여러 작업 조합
      • 예외 처리 등
@JuHyun419 JuHyun419 added the Java label Apr 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant