CS
-
OS 기초 지식CS 2022. 8. 2. 23:09
Interrupt(인터럽트) 인터럽트는 하드웨어 인터럽트, 소프트웨어 인터럽트로 나뉜다. 하드웨어 인터럽트 (인터럽트) 소프트웨어 인터럽트 (트랩) 인터럽트 핸들링 인터럽트가 발생한 경우에 처리해야 할 일들의 절차를 말한다. 프로그램 a가 실행되고 있을 때, 인터럽트가 발생한다면 ? a의 현재 상태를 먼저 저장한다. (현재 상태는 현재 CPU에서 실행중인 명령의 메모리 주소 및 부가적인 정보를 의미 한다.) 인터럽트 처리 루틴을 통해 인터럽트 들어온 것을 수행한다. 저장된 a의 상태를 불러와 다시 수행한다. 좀더 구체적인 설명으로 OS는 현재 시스템 내에서 실행되는 프로그램들을 관리하기 위해 PCB(프로세스 제어 블록)을 가진다. PCB는 각각의 프로그램 마다 하나 씩 존재하며, 해당 프로그램의 어디를 ..
-
메모리? 메인 메모리?CS 2021. 1. 12. 22:14
메모리 종류에는 메인 메모리, 캐시 메모리가 존재 한다. 메인 메모리(Main Memory) 메인 메모리는 CPU가 직접 접근할 수 있는 접근 장치로 프로세스가 실행되려면 프로그램이 메모리에 올라와야 한다. 메인 메모리는 주소가 할당된 일련의 바이트들로 구성되어 있다. CPU는 레지스터가 지시한 대로 메모리에 접근해 다음에 수행할 명령어를 가져온다. 명령어를 수행할 시 메모리에 필요한 데이터가 없으면 해당 데이터를 우선 가져오게 되는데 이 역할을 하는것이 MMU이다. MMU(Memory Management Utility)란 메모리 관리 장치로 논리 주소를 물리 주소로 변환해 주며, 메모리 보호나 캐시 관리 등 CPU가 메모리에 접근하는 것을 총 관리하는 하드웨어이다. 메모리의 공간은 한정적이기 때문에 사..
-
파일 시스템CS 2021. 1. 7. 02:19
컴퓨터에서 파일이나 자료를 쉽게 검색하고 유지 및 관리하는 방법을 말한다. 커널 영역에서 동작하며 파일의 CRUD를 원할하게 수행하기 위한 목적을 가지고 있다. 계층적인 디렉터리 구조로 이루어져 있으며 디스크 파티션 별 하나씩 둘 수 있다. 역할은 주로 파일, 보조 저장소 관리, 파일 무결성 메커니즘, 접근 방법 제공이 존재하며 개발의 목적으로 파일관리, 하드디스크와 메인 메모리의 속도차를 줄이는 것, 하드디스크 용량을 효율적으로 이용하는데 있다. 구조는 데이터 영역에 기록된 파일의 이름, 위치, 크기, 시간 정보 등 파일 정보를 담은 메타영역과 파일의 데이터를 담고 있는 데이터 영역이 존재한다. 접근 방식으로 순차 접근, 직접 접근, 기타 접근이 존재한다. 순차 접근 (Sequential Access)..
-
IP(Internet Protocol)?CS 2021. 1. 3. 02:10
IP 즉, 인터넷 프로토콜이란? 지정한 IP 주소(IP address)에 패킷(packet) 단위로 데이터를 전달 한다. IP packet 정보 출발지 ip, 목적지 ip, message 클라이언트의 패킷 전달 클라이언트는 패킷에 정보를 저장하고 인터넷 망에 던진다(?) 이후 노드간 이동을 통해 목적지 서버 ip 까지 찾아가며 전달된다. IP protocol의 한계 비연결성 - 패킷을 받을 대상이 없거나 서비스가 불가능한 상태에도 패킷을 전송한다. 비신뢰성 - 중간에 패킷이 사라지거나 패킷이 순서대로 오지않을 수 있다. 프로그램 구분 - 같은 ip를 사용하는 서버에서 통신하는 애플리케이션이 둘 이상이라면? TCP, UDP 인터넷 프로토콜 스택의 4계층 애플리케이션 - HTTP, FTP 전송 - TCP,..
-
로드 밸런싱?CS 2020. 12. 22. 21:41
둘 이상의 CPU or 저장장치와 같은 컴퓨터 자원들에게 작업을 나누는 것을 말한다. 웹의 발전으로 인해 웹사이트에 접속하는 인원이 급격하게 늘어나고 결국 이는 트래픽량의 급증을 보여준다. 모든 트래픽을 감당하기에는 1대의 서버로는 부족하게 되는 상황이 되었다. 이에 대한 대응 방안으로 하드웨어의 성능을 올리는 Scale Up 방법과 여러대의 서버가 나눠 일하는 Scale Out 방식이 존재한다. Scale up 의 경우 하드웨어 향상 비용이 비싸다는 문제가 존재한다. Scale out을 통해 서버를 여러대 둔다면 무중단 서비스를 제공하는 환경 구성에 용이하고 효과적이다. 이때 여러 서버에 균등하게 트래픽을 분산 시켜주는 방식을 로드밸런싱이라 한다. 로드 밸런싱은 분산식 웹 서비스로, 여러 서버에 부하(..
-
해싱(Hashing)?CS 2020. 12. 22. 02:47
해시함수란? 데이터의 효율적 관리를 목표로 임의의 길이 데이터를 고정된 길이의 데이터로 매핑하는 함수를 말한다. 이때 매핑전 원레 데이터의 값을 키(key), 매핑 후 데이터 값을 해시값(Hash Value), 매핑하는 과정을 해싱(Hashing)이라한다. 해시테이블의 크기가 m이라면 좋은 해시함수는 임의의 키값을 임의의 해시값에 매핑할 확률이 1/m이다. 특정한 값에 치우지지 않고 해시값을 고르게 만들어내는 해시함수가 좋은 해시함수라 할 수 있다. division method 간단하면서 빠른 연산이 가능한 해시함수, 숫자로 된 키를 해시테이블 크기 m으로 나눈 나머지 값을 해시값으로 반환한다. m은 대게 소수를 쓰며 특히 2의 제곱수와 거리가 먼값을 사용하는 것이 좋다. 해시함수의 특성 때문에 해시테이..
-
세마포어? 데드락?CS 2020. 12. 14. 20:46
데드락? 프로세스가 자원을 얻지 못해 다음 처리를 하지 못하는 상태를 말한다. 교착 상태라고도 한다. 프로세스 1,2가 각 자원 1,2를 모두 얻어야 한다고 가정한 상황이다. t1 : 프로세스1이 자원 1을 얻음, 프로세스2가 자원 2를 얻음. t2 : 프로세스1은 자원 2를 기다림, 프로세스2는 자원 1을 기다림. 두 프로세스 모두 원하는 자원이 상대방에 할당되어 있어 무한정 wait에 걸린다. 이러한 상황을 데드락이라 한다. 주로 멀티 프로그래밍 환경에서 한정된 자원을 얻기 위해 경쟁하는 상황에서 발생한다. 프로세스가 자원을 요청했을 때 자원을 사용할 수 없어 대기상태에 들어가는데 대기 상태에서 실행 상태로 변경될 수 없을 때도 데드락이라 한다. 데드락 발생조건 1. 상호 배제 (Mutual Excl..
-
프로세스 vs 쓰레드CS 2020. 12. 13. 02:39
프로그램 어떤 작업을 위해 실행할 수 있는 명령어의 집합 저장 장치에 저장되어있지만 메모리에 올라가지 않은 정적인 상태 프로세스 운영체제로 부터 자원을 할당 받은 작업의 단위 실행되고 있는 동적인 상태의 프로그램 특징 각각 독립된 메모리 영역 (Code, Data, Stack, Heap)을 할당 받는다. 프로세스당 최소 1개의 스레드(메인 스레드)를 가지고 있는다. 각 프로세스는 별도의 주소 공간에서 실행되며, 한 프로세스는 다른 프로세스의 자원에 접근할 수 없다. 다른 프로세스의 자원에 접근하고 싶다면 프로세스간의 통신(IPC)를 사용해야 한다. 스레드 프로세스가 할당받은 자원을 이용하는 실행 흐름의 단위 프로세스의 특정한 수행 경로 특징 스레드는 프로세스 내에서 stack만 따로 할당 받고 Code,..