<!--[if gte mso 9]><xml> </xml><![endif]-->
<!--[if gte mso 9]><xml> Normal002falsefalsefalseEN-USKOX-NONE </xml><![endif]--><!--[if gte mso 9]><xml> </xml><![endif]--><!--[if gte mso 10]> <style> /* Style Definitions */ table.MsoNormalTable {mso-style-name:"표준 표"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-parent:""; mso-padding-alt:0cm 5.4pt 0cm 5.4pt; mso-para-margin-top:0cm; mso-para-margin-right:0cm; mso-para-margin-bottom:10.0pt; mso-para-margin-left:0cm; text-align:justify; text-justify:inter-ideograph; line-height:115%; mso-pagination:widow-orphan; font-size:10.0pt; mso-bidi-font-size:11.0pt; font-family:"맑은 고딕"; mso-ascii-font-family:"맑은 고딕"; mso-ascii-theme-font:minor-latin; mso-fareast-font-family:"맑은 고딕"; mso-fareast-theme-font:minor-fareast; mso-hansi-font-family:"맑은 고딕"; mso-hansi-theme-font:minor-latin; mso-font-kerning:1.0pt;} </style> Why CPU computations could be done in user mode?
이거는 질문부터 잘 이해가 안가는데 왜 cpu 계산은 유저모드에서 끝낼 수 있는가? 맞나여??
cpu를 쓰는 대부분의 작업이 user mode 에서 요청하기 때문에 그런거 아닌가여? 머지?ㅜ
단순한 계산이라면 커널 수준의 특권 명령이 필요없이 계산 명령어만 사용할 테니깐... 하지만 이걸 화면에 띄운다던가 어떤 식으로든 유저에게 인터페이스적으로 알려주려면 시스템 콜이 필요하겠지...
어디서 저런 의문이 출발했는지 모르겠는데, 일단 유저 모드<->커널 모드로 진입하는 중에 컨텍스트 스위칭은 비용이 대단히 큼. 그래서 시스템은 가능하면 꼭 필요한 경우가 아니면 상대 영역으로 안 넘어가게 설계되어 있음.
/ㅅㅅㅅ IO와는 다르게 보안이나 독점등에 대한 문제를 고려할 필요가 없으니까 굳이 커널모드에서 할 필요가 없는거군여
/mm 교수님이 내준 토픽이에여 컨텍스트 스위칭 비용이라는건 시간을 말하는건가여??
비단 유저 모드, 커널 모드 전환 뿐 아니라 함수 호출에도 해당되는 이야기인데, 코드가 달라지면 레지스터에 다른 값을 쳐넣게 되기 때문에 그 코드를 부른 원래 코드로 돌아가기 전에 레지스터의 값을 복구시켜야 하므로 레지스터의 값을 스택 같은 데에 백업해야 하는데 이 비용이 좀 됨
/ㅅㅅㅅ 아하!