전체 글 54

4강. 연습문제

4강. 연습문제 4.1 Provide two programming examples in which Multithreading does not provide better performance than a single-threaded solution. (1) Sequential Program은 Multithread에 불리하다. 순차 계산 프로그램 . ex. 개인 세금 계산 프로그램. (2) 환경변수, 작업 디렉토리, 파일을 계속 monitor 해야하는 프로그램. ex. C-shell, korn shell 4.3 Which of the following components of program state are shared a cross threads in a multithread process? a. Regi..

Computer Science/OS 2023.11.27

Threads

Threads( Light Weight Process ) ⇒ CPU 이용의 가장 작은 단위. Thread ID Program Counter Register Stack Space 등으로 구성되어있다. Peer Threads 와는 Code Section (명령어) Data Section (명령어 실행에 필요한 정보) OS Resources 등을 공유한다. 🛑 하나의 Process에 하나의 Thread만 존재할 때 Heavy Weight Process라고 한다. Multithread에서는 한 Thread가 Blocked 되어도 다른 Thread가 Run할 수 있다. → 처리량과 성능이 증가한다. ⬆️ ⬆️ ⬆️ ⬆️ ⬆️ ⬆️ ⬆️ ⬆️ Thread의 장점 Responsiveness : 반응시간이 좋아진다. ..

Computer Science/OS 2023.11.25

3강 연습문제

3.1 Describe the differences among short-term, medium-term, and long-term scheduling Short-term Scheduler : Ready Queue에서 Process를 선택하여 CPU에 할당하는 작업을 한다. 아주 빠르고, 자주 일어난다. (frequently, fast) Long-term Scheduler : Job Queue에서 Process를 선택해 Ready Queue로 옮긴다. Degree of Multiprogramming을 Control하는 놈이다. Main Memory에 올라가는 Process의 갯수를 조절하여 degree를 조절한다. Midium-term Scheduler : Swapping을 담당한다. Event를 기다리..

Computer Science/OS 2023.11.25

Processes(2)

Cooperating Process Independent Process : 다른 Process와 독립적으로 동작하는 Process. 다른 Process에 영향을 주지도, 영향을 받지도 않는다. Cooperating Process : 다른 Process들과 영향을 주고받는 Process (ex. Parent-Child Process) 장점 (Advantage of Cooperating Process) 정보 공유 (Information Sharing) 처리속도 향상 (Computation Speed-UP) 모듈화 (Modularity) 편의성 (Convenience) Role Producer : 정보 or 기능을 제공하는 Process (ex. Compiler, Assembler, Webserver) Con..

Computer Science/OS 2023.11.24

Processes(1)

Process a program in execution : 실행중인 프로그램, 다음과 같은 Resource들을 가진다 Program Counter Stack Data Section Process State New : Process가 새로 생겼을 때 Running : Process가 실행중일 때 Waiting : Process가 어떤 Event를 기다리는 상태 (ex. I/O Operations) Ready : Process가 CPU에 할당되기를 기다리는 상태 Terminated : Process의 실행이 완료되고 종료됨. Process Control Block(PCB) 프로세스의 정보를 저장하는 Block. 다음의 정보를 저장한다. Process State Program Counter ( 다음 Instr..

Computer Science/OS 2023.11.24

운영체제 2강 연습문제

2.5 What is the purpose of the Command interpreter? Why is it usually seperate from the kernel? Would it be possible for the user to develope a new Command interpreter using the System Call interface provided by the Operating System? Purpose : User나 File로부터 Command를 받아 실행할 때, 한개 이상의 System Call을 호출한다. Kernel이 아닌 Command Interpreter가 command를 받아 처리한다. Command Interpreter가 변결될 수 있어 Kernel과 Command..

Computer Science/OS 2023.11.21

Operating System Structures(2)

Objective OS의 다양한 구조를 알 수 있다. OS가 어떻게 설치되고 부팅되는지 알 수 있다. Operating System Design and Implementation 운영체제의 설계와 구현. 운영체제를 개발하는 방법론은 존재하지 않는다. But, 몇몇의 성공적이라고 증명된 접근법이 존재. OS는 하드웨어와 시스템 유형에 영향을 받는다. *시스템 유형 : Batch, Timesharing, Single User, Multi User, Distributed, Realtime 등. Goals User Goals : 사용하기 편하고, 배우기 쉽고, 안정적이고, 안전하고 속도가 빨라야한다. System Goals : 설계와 구현, 유지 보수가 쉬워야하고, 유연하고 안정적이고, 오류가 없고 효율적이여야..

Computer Science/OS 2023.11.21

Mysql 8.x 비밀번호 재설정 방법

mac 기준으로 설명 1. mysql을 멈춘다. mysql.server stop 2. mysql을 skip-grant-tables 모드로 재실행한다. mysql.server start --skip-grant-tables 3. root 유저의 비밀번호를 null로 바꿔준다. UPDATE mysql.user SET authentication_string=null WHERE User='root'; FLUSH PRIVILEGES; exit; 4. 다시 root 계정으로 로그인한다. 비밀번호를 null로 바꿨기 때문에 패스워드 없이 로그인이 가능하다. mysql -u root 5. 비밀번호를 변경해준다. ALTER USER 'root'@'localhost' IDENTIFIED WITH caching_sha2_pa..

Database/MySQL 2023.11.20

Operating System Structures (1)

Objectives OS가 User, Process, 다른 System에 제공하는 Service가 무엇인지 알 수 있다. Operating System Services 운영체제가 User에게 제공하는 것들. 1. User Interface CLI( Command Line Interface ) : Command를 통해 제어하는 것. GUI( Graphics User Interface ) : Graphic을 통해 제어하는 것. 여러 운영체제는 CLI와 GUI를 동시에 제공한다. 2. Program Execution Program을 Load, Run, Execution, End 비정상 종료 : Error → aborting 된다고 이야기한다. 3. I/O Operations 4. File-System Mani..

Computer Science/OS 2023.11.20

운영체제 1강 연습문제

1.5 Distinguish between the client-server and peer-to-peer models of distributed systems Client-Server 모델에서는 전용 Server와 특정 Client가 있다. Server는 Client에 서비스를 제공한다. 데이터가 중앙집중식으로 서버에 저장된다 Peer To Peer 모델에서는 각 노드가 Server와 Client의 역할을 모두 수행할 수 있다. Peer간 서비스를 제공, 요청할 수 있다. 데이터는 Peer에 저장되므로 분산되어 있다. 1.7 What is the purpose of interrupt? What are the differences between a trap and an interrupt? Can traps..

Computer Science/OS 2023.11.20