process management - 2

Jeong seulhoยท2023๋…„ 1์›” 18์ผ
0

์šด์˜์ฒด์ œ

๋ชฉ๋ก ๋ณด๊ธฐ
5/35

๐Ÿ“Œinterrupt(์ธํ„ฐ๋ŸฝํŠธ)

  • ์˜ˆ์ƒํ•˜์ง€ ๋ชปํ•œ, ์™ธ๋ถ€์—์„œ ๋ฐœ์ƒํ•œ ์ด๋ฒคํŠธ
  • ์ธํ„ฐ๋ŸฝํŠธ ์ข…๋ฅ˜
    • clock
    • console
    • program check
    • I/O ๋“ฑ

๐Ÿ“Œinterrupt ์ฒ˜๋ฆฌ ๊ณผ์ •

  1. ์ธํ„ฐ๋ŸฝํŠธ ๋ฐœ์ƒ
  2. ํ”„๋กœ์„ธ์Šค ์ค‘๋‹จ(์ปค๋„ ๊ฐœ์ž…)
  3. ์ธํ„ฐ๋ŸฝํŠธ ์ฒ˜๋ฆฌ
    3-1. ์ธํ„ฐ๋ŸฝํŠธ ๋ฐœ์ƒ ์žฅ์†Œ, ์›์ธ ํŒŒ์•…(interrupt handling)
    3-2. ์ธํ„ฐ๋ŸฝํŠธ ์„œ๋น„์Šค ์—ฌ๋ถ€ ๊ฒฐ์ •(interrupt handling)
    3-3. ์ธํ„ฐ๋ŸฝํŠธ ์„œ๋น„์Šค ๋ฃจํ‹ด ํ˜ธ์ถœ(interrupt service)

๐Ÿ“Œcontext์— ๊ด€ํ•ด

๐Ÿ“–context

  • ํ”„๋กœ์„ธ์Šค์™€ ๊ด€๋ จ๋œ ์ •๋ณด๋“ค์˜ ์ง‘ํ•ฉ
    • cpu register context - cpu ๋‚ด๋ถ€์— ์œ„์น˜
    • code & data, stack, PCB - memory์— ์œ„์น˜

๐Ÿ“–context saving

  • ํ˜„์žฌ ํ”„๋กœ์„ธ์Šค์˜ register context๋ฅผ ๋ฉ”๋ชจ๋ฆฌ์— ์ €์žฅ
  • ์ธํ„ฐ๋ŸฝํŠธ ๋ฐœ์ƒ์‹œ cpu์—์„œ ์ซ“๊ฒจ๋‚˜๊ณ  ๋ฉ”๋ชจ๋ฆฌ์— ์ €์žฅํ•ด๋‘๋Š” ๊ฒƒ์ž„

๐Ÿ“–context restoring

  • ๋ฉ”๋ชจ๋ฆฌ์˜ register context๋ฅผ ํ”„๋กœ์„ธ์Šค๋กœ ๋ณต๊ตฌ

๐Ÿ“–context switching = process switching

  • ์œ„์˜ saving, restoring ๊ณผ์ •์„ ํ•ฉ์ณ์„œ ๋ถ€๋ฅด๋Š” ๋ง
  • ์ปค๋„์˜ ๊ฐœ์ž…์œผ๋กœ ์ด๋ฃจ์–ด์ง

๐Ÿ“–context switching overhead

  • context switching์— ์†Œ๋ชจ๋˜๋Š” ๋ฉ”๋ชจ๋ฆฌ์™€ ์‹œ๊ฐ„์„ ์˜๋ฏธ(๋น„์šฉ, ์ž์›)
  • os์˜ ์„ฑ๋Šฅ์— ํฐ ์˜ํ–ฅ์„ ์ค€๋‹ค
  • ๋ถˆํ•„์š”ํ•œ context switching์„ ์ค„์ด๋Š” ๊ฒƒ์ด ์ค‘์š”
  • ํ•ด๊ฒฐ๋ฐฉ๋ฒ• thread ์‚ฌ์šฉ


์ธํ„ฐ๋ŸฝํŠธ ๋ฐœ์ƒ ํ”Œ๋กœ์šฐ

๐Ÿ“ฎ์ถœ์ฒ˜ : https://www.youtube.com/watch?v=hzXVQIlSSos&list=PLBrGAFAIyf5rby7QylRc6JxU5lzQ9c4tN

0๊ฐœ์˜ ๋Œ“๊ธ€