Synchronous vs Asynchronous

๋™๊ธฐ์™€ ๋น„๋™๊ธฐ์˜ ์ฐจ์ด

-> ์ˆœ์„œ์™€ ๊ฒฐ๊ณผ(์ฒ˜๋ฆฌ)์˜ ๊ด€์ 

Synchronous (๋™๊ธฐ)

  • ์ž‘์—…์„ ์š”์ฒญํ•œ ํ›„, ํ•ด๋‹น ์ž‘์—…์˜ ๊ฒฐ๊ณผ๊ฐ€ ๋‚˜์˜ฌ ๋•Œ๊นŒ์ง€ ๊ธฐ๋‹ค๋ฆฐ ํ›„ ์ฒ˜๋ฆฌ ํ•˜๋Š” ๊ฒƒ์œผ๋กœ, I/O ์ž‘์—…์— ๋Œ€ํ•œ readiness ๋ฅผ ๊ธฐ๋‹ค๋ฆฐ๋‹ค

    • ํŠน์ • I/O ์ž‘์—…์„ ํ•˜๊ธฐ ์œ„ํ•œ ์ค€๋น„๊ฐ€ ๋˜์—ˆ๋Š”์ง€์— ์ง‘์ค‘ํ•˜๋Š” ๊ฒƒ

Asynchronous (๋น„๋™๊ธฐ)

  • ์ž‘์—…์„ ์š”์ฒญํ•ด ๋†“๊ณ , ๋‹ค๋ฅธ ์ผ์„ ํ•˜๋‹ค๊ฐ€ ํ•ด๋‹น ์ž‘์—…์ด ์™„๋ฃŒ๋˜๋ฉด ๊ทธ ๋•Œ ์™„๋ฃŒ๋˜์—ˆ์Œ์„ ํ†ต์ง€๋ฐ›๊ณ , ๊ทธ์— ๋”ฐ๋ฅธ ์ž‘์—…์„ ์ฒ˜๋ฆฌํ•˜๋Š” ๊ฒƒ์„ ๋งํ•œ๋‹ค

  • ์šด์˜์ฒด์ œ ๋‹จ๊ณ„์˜ ๋น„๋™๊ธฐ API๋ฅผ ํ†ตํ•ด ์ด๋ฃจ์–ด์ง€๋ฉฐ, I/O ์ž‘์—…์ด ์™„๋ฃŒ๋˜๋ฉด, ๊ทธ์— ์ ํ•ฉํ•œ handler๋ฅผ ์ด์šฉํ•ด ์ฒ˜๋ฆฌ๋ฅผ ํ•œ๋‹ค

Synchronous (๋™๊ธฐ) vs Asynchronous (๋น„๋™๊ธฐ)

  • system call ์˜ ์™„๋ฃŒ๋ฅผ ๊ธฐ๋‹ค๋ฆฌ๋ฉด synchronous

  • system call ์˜ ์™„๋ฃŒ๋ฅผ ๊ธฐ๋‹ค๋ฆฌ์ง€ ์•Š์œผ๋ฉด asynchronous

Last updated