Skip to content

Instantly share code, notes, and snippets.

@xodhx4
Created April 2, 2020 11:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xodhx4/a8f3f4ed77e5bb57bee81ef5af945728 to your computer and use it in GitHub Desktop.
Save xodhx4/a8f3f4ed77e5bb57bee81ef5af945728 to your computer and use it in GitHub Desktop.
Markdium-JS 초보가 쓰는 async await 처음부터 이해하기
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