Interrupt, Exception [Operating System]

Interrupt, Exception [Operating System]

  • interrupt = 하드웨어장치로 생성(Generated by hardware devices)
  • exception = 실행중인 소프트웨어에 의해 생성됨.(Generated by software executong instructions)

interrupt(hardware)

polling(spinning)

polling은 계속해서 체크하는 방법이다.(while(1){확인}이런것으로 이해하면 이해하기 쉬울 것 같다.)

해당 작업이 끝나기 전까지 다른 작업이 불가능하다.

ex) xx야 뭐뭐 끝났니? 끝났니? 끝났니? 이렇게 계속 물어보는 것.

hardware interrupt

하드웨어가 알아서 cpu한테 알려주는 방식

hardware interrupt는 polling과는 다르게 하드웨어가 알려주기 전까지 다른 작업이 가능하다.

 

Q: h/w interrupt가 polling보다 항상 좋을까?

A: 대부분 hardware interrupt가 좋지만 1나노 sec정도일때는 polling이 더 좋을 수 있다.(매우 짧을 때)

exception(software)

Traps

  • 의도적
  • 시스템 호출(system call), breakpoint traps, special instructions
  • 다음 명령어 제어로 복귀(return control to "next" instruction

Faults

  • 의도적이지 않음.(문제가 생겨서 운영체제가 간섭해야 될 상황)
  • 복구가 될 수도 있고 되지 않을 수도 있음.
  • page faults(복구 가능(recoverable)), protection faults(복구 불가능(unrecoverable))
  • 현재 명령을 재실행하거나 중단
...더보기

ex/

page faults= 메모리를 읽으려고 하는데 그 메모리가 pisycal한 메모리에 올라와 있지 않을 때

protection faults= 다른 유저가 어떤 파일을 만들어서 그 사람 말고는 아무도 읽지 못하게 해놓았는데 다른 유저가 읽으려고 할 때.(권한이 없는데 읽으려고 할 때)

Aborts

  • 의도하지 않음.
  • 복구 불가능
  • 패리티오류(parity error machine check)
  • 현재 프로그램 중단.(복구가 불가능하므로 프로세스를 종료해서 해결)

Designed by JB FACTORY