Computer Engineering/운영체제
-
교착 상태 / 필요 조건, 해결 방법Computer Engineering/운영체제 2022. 11. 24. 13:43
교착 상태 Deadlock 2개 이상의 프로세스가 진행되지 못 하고 작업을 완료하지 못하는 상태 교착상태는 공유 변수를 사용하기 때문에 발생 교착 상태의 발생 필요 조건 상호 배제 Mutual Exclusion : 한 프로세스가 사용하는 자원은 다른 프로세스와 동시에 공유할 수 없는 상호 배제적 자원이어야 함 점유 대기 Hold and Wait : 프로세스가 자원을 할당받은 상태에서 다른 자원을 기다려야함 비선점 No preemption : A 프로세스가 사용중인 자원을 B 프로세스가 빼앗을 수 없음 순환 대기 Circular Wait : 점유와 대기를 하는 프로세스간 관계가 원을 이루어야 함 교착 상태의 해결방법 교착 상태의 예방 상호 배제 조건 제거 : 공유 불가능 하다는 조건을 제거 점유와 대기 조..
-
공유자원, 임계구역 / 임계구역 해결조건Computer Engineering/운영체제 2022. 11. 23. 14:50
공유 자원 : 프로세스끼리 공유하는 자원 여러 프로세스가 공동으로 이용하는 변수, 메모리, 파일 등 공동으로 이용되기 때문에 데이터를 누가, 언제 읽고 쓰느냐에 따라 데이터가 달라짐 임계 구역 : 프로세스에게 동시에 공유되어서는 안되는 공간 공유 자원 접근 순서에 따라 실행 결과가 달라지는 프로그램 영역 임계 구역 내에서는 프로세스들이 동시에 작업 X 임계 구역 해결조건 상호 배제 Mutual exclusion 한 프로세스가 임계 구역에 들어가면 다른 프로세스는 임계 구역 접근 불가 한정 대기 Bounded waiting 어떤 프로세스도 무한 대기하지 않아야 함 진행의 융통성 Progress flexibility 프로세스 간 진행을 방해해서는 안됨 임계 구역 알고리즘 피터슨 알고리즘 데커 알고리즘 세마포..
-
프로세스 간 동기화 및 통신Computer Engineering/운영체제 2022. 11. 15. 14:14
프로세스 간 통신 프로세스 내부 데이터 통신 프로세스 내부에 2개 이상의 스레드가 존재 프로세스 내부의 스레드는 전역 변수나 파일을 이용하여 데이터 통신 프로세스 간 데이터 통신 같은 컴퓨터 내부의 프로세스끼리 데이터 통신 공용 파일 또는 파이프를 사용하여 데이터 통ㅇ신 네트워크를 이용한 데이터 통신 여러 컴퓨터를 네트워크를 통해 데이터 통신 소켓을 이용하여 데이터 통신 통신 방향에 따른 분류 양방향 통신 데이터를 양방향으로 동시 전송 가능 ex) 프로세스 통신 간 소켓 통신 반양방향 통신 양방향으로 전송을 가능하나, 동시 전송이 불가능 ex) 무전기 단방향 통신 한쪽 방향으로만 데이터 전송 ex) 전역변수, 파이프 통신 구현에 따른 분류 대기가 있는 통신 : 데이터를 받는 쪽은 데이터가 도착할 때 까지..
-
파일과 파일 시스템Computer Engineering/운영체제 2022. 11. 15. 13:49
파일 시스템 파일 관리자를 두어 저장장치의 관리를 맡기는 시스템 파일관리자로부터 접근 권한을 얻어야 파일 접근 가능 파일 테이블 사용 블록 저장장치에서 사용하는 가장 작은 단위, 한 블록에 주소 하나 할당 파일 분류 실행 파일 : 운영체제가 메모리로 올려 CPU를 사용하여 작업을 하는 파일 데이터 파일 : 실행 파일이 작업하는데 필요한 데이터를 모아놓은 파일 파일 속성 파일 이름 파일 종류 파일 크기 파일 접근 시간 파일의 위치 파일의 접근 권한 파일의 소유자 파일 헤더와 고유 헤더 파일 헤더 : 파일 테이블 관리 / 파일의 이름, 종류, 크기, 시간, 접근 권한 등 정보를 보유 고유 헤더 : 응용프로그램이 필요로 하는 정보 ex) 파일의 버전 번호, 크기, 특수 정보 등 파일 구조 순차 파일 구조 파일..
-
스레싱과 프레임할당Computer Engineering/운영체제 2022. 11. 14. 14:05
스레싱 I / O가 너무 많아져서 잦은 페이지 부재로 작업이 멈춘 것 같은 상태 스레싱 발생 시점 CPU가 작업하는 시간보다 스왑인 / 스왑아웃 작업이 많아져서 CPU가 작업할 수 없는 정도 프레임 할당 프로스세에 얼마나의 프레임을 할당할 것인가에 관한 문제 정적 할당 균등 할당 : 모든 프로세스에게 프레임을 동일하게 할당 비례 할당 : 프로세스의 크기에 비례하여 프레임을 할당 동적 할당 작업집합 모델 : 일정 시간동안 참조된 페이지들을 집합으로 만들고, 물리 메모리에 유지 작업 집합 크기 : 물리 메모리에 유지할 페이지 크기 작업 집합 윈도우 : 작업 집합에 포함되는 페이지 범위 페이지 부재 빈도 : 페이지 부재 횟수를 기록하여 페이지 부재 비율을 계산하는 방식 부재 비율이 상한선을 초과하면 프레임 추..
-
CPU 스케줄링Computer Engineering/운영체제 2022. 11. 14. 13:26
CPU 스케줄러 운영체제에서 CPU와 시스템의 자원을 효율적으로 사용하기 위해, 프로세스를 배정 고수준 스케줄링 : 시스템 내의 전체 작업 수를 조절 저수준 스케줄링 : 어느 프로세스에 CPU를 할당할지, 어느 프로세스를 대기 상태로 보낼지 결정 중간수준 스케줄링 : 활성화된 프로세스의 수를 조절 고수준 스케줄링 전체 시스템의 부하를 고려하여 작업을 시작할지 말지를 결정 중간 수준 스케일링 시스템에 과부하가 걸려서 전체 프로세스 수를 조절해야 한다면 이미 활성화된 프로세스 중 일부를 보류 상태로 보냄 저수준 스케줄링 실제 작업을 수행 선점형 스케줄링과 비선점형 스케줄링 선점형 스케줄링 : 진행 중이던 프로세스의 작업을 중단하고 새로운 작업을 시작할 수 있는 방식 / 시분할 시스템 비선점형 스케줄링 : 진..
-
하드 디스크의 구성 및 스케줄링Computer Engineering/운영체제 2022. 11. 14. 12:20
하드디스크 컴퓨터의 보조 기억장치로, 비휘발성 저장장치이다. 하드디스크의 구조 전원 커넥터 : 전원을 공급하는 역할 데이터 커넥터 : 하드디스크와 컴퓨터 사이의 데이터 전송해주는 역할 헤드 : 데이터를 읽고 쓰는 역할 엑츄에이터 / 디스크 암 : 헤드를 움직이는 팔 역할 플래터 : 하드디스크 내부의 데이터가 저장되는 공간 자기를 이용하여 0과 1의 데이터를 저장 플래터의 표면이 N극 = 0, S극 = 1 섹터 하드디스크의 가장 작은 저장 단위 하나의 섹터에 한 덩어리의 데이터 저장 블록 / 클러스터 여러 개의 섹터로 구성되어 있는 저장 단위 하드디스크와 컴퓨터 사이에 데이터를 전송하는 논리적 저장 단위 중 가장 작은 단위 윈도우 운영체제에서는 클러스터 Cluster라고 표현 트랙 : 회전축을 중심으로 동..
-
프로세스와 스레드Computer Engineering/운영체제 2022. 10. 31. 11:45
프로세스와 스레드 프로그램 : 일련의 명령문 집합체로, 저장장치에 저장되어 있는 정적인 상태 프로세스 : 프로그램이 실행을 위해 메모리에 올라온 동적인 상태 스레드 : 프로세스보다 작은 실행 흐름의 단위 프로세스의 구조 정적 영역 Code 영역 : 프로그램의 본문, 명령어가 기술된 곳 / Read Only 영역 ex) 함수, 상수 저장 Data 영역 : 프로그램이 사용하는 데이터를 저장하는 공간 ex) 전역 변수 저장 동적 영역 : 프로세스가 실행되는 동안 구성되는 영역으로, 동적 할당 영역 Stack 영역 : 함수의 수행을 마치고 복귀할 주소 및 데이터를 임시로 저장하는 공간 ex) 지역/매개 변수 저장 Heap 영역 : 사용자가 관리하고 사용하는 메모리 영역 ex) 동적 할당 영역 프로세스 제어 블록..