Created
April 2, 2020 11:29
-
-
Save xodhx4/a8f3f4ed77e5bb57bee81ef5af945728 to your computer and use it in GitHub Desktop.
Markdium-JS 초보가 쓰는 async await 처음부터 이해하기
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
future = excutor.submit(open, "example.txt", "r") // Non-Blocking IO로 IO 작업 시작 | |
some_cpu_job1() // cpu 작업이 IO작업이 끝나기 전에 끝난다 | |
f = future.result() // 결과값을 가져올 떄까지 쓰레드가 Blocking된다 -> 비효율적 | |
print(f.readline()) | |
some_cpu_job2() | |
some_cpu_job3() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment