CS
-
CPU 스케줄링 알고리즘CS 2020. 12. 12. 22:44
CPU가 하나의 프로세스 작업이 끝나면 그 다음 프로세스 작업을 수행해야 한다. 이때 작업을 선택하는 알고리즘을 CPU 스케줄링 알고리즘이라 한다. 1. Preemptive VS Non-preemptive (선점 vs 비선점) Preemptive의 경우 프로세스가 CPU를 점유하고 있는 동안 I/O 요청이나 인터럽트가 발생한 것도 아니고 모든 작업을 끝내지도 않았는데, 다른 프로세스가 해당 CPU를 강제로 점유할 수 있는 경우를 말한다. 즉 프로세스가 정상적으로 수행중인데 다른 프로세스가 CPU를 강제로 점유해서 실행할 수 있는 것을 말한다. Non-Preemptive의 경우 한 프로세스가 CPU를 점유 했다면, I/O요청이나 인터럽트가 발생 또는 프로세스가 종료 될 때 까지 다른 프로세스가 CPU를 점..
-
트랜잭션 격리 수준?CS 2020. 12. 11. 18:56
트랜잭션 격리 수준 이란 트랜잭션에서 일관성 없는 데이터를 허용하도록 하는 수준을 말한다. 데이터베이스의 경우 ACID 특징과 같이 트랜잭션이 독립적인 수행을 하도록 한다. 따라서 locking을 통해, 트랜잭션이 데이터베이스를 다루는 동안 다른 트랜잭션이 관여하지 못하도록 막는 것이 필요하다. 트랜잭션 격리 레벨의 종류 ? 1. Read Uncommitted (레벨 0) - select 수행되는 동안 해당 데이터에 shared lock이 걸리지 않는 계층 트랜잭션이 처리 중이거나, 아직 Commit 되지 않은 데이터를 다른 트랜잭션이 읽는 것을 허용하는 수준의 격리. 사용자 1이 A라는 데이터를 B로 변경하는 동안 사용자 2가 아직 완료 되지않은 트랜잭션이지만 데이터 B를 읽을 수 있다. 즉 데이터베이..
-
객체지향 프로그래밍 (OOP)CS 2020. 12. 9. 17:50
객체의 개념 소프트웨어 객체는현실 세계의 객체를 필드와 메서드로 모델링 한것 상태를 필드, 동작을 메서드로 정의 한다. 필드는 객체 내부에 선언된 변수를, 메서드는 객체 내부에 정의된 동작을 의미한다. 객체지향의 주요 개념 캡슐화 (정보 은닉) 관련된 필드와 메서드를 하나의 캡슐처럼 포장해 세부 내용을 외부에서 알 수 없도록 감추는 것. 함께 코드를 재수정 없이 재활용하는 것. 관련된 기능과 특성을 한 곳에 모으고 분류하기 때문에 재활용이 원활해졌다. 상속 자녀가 부모 재산을 상속 받아 사용하듯이 상위 객체를 상속받은 하위 객체가 상위 객체의 메서드와 필드를 사용하는 것 부모클래스의 속성과 기능을 그대로 이어 받아 사용할 수 있게하고 기능의 일부분을 재정의 하여 사용할 수 있게 하는 것. 다중 상속은 불..
-
잡다한 CS 지식 공부CS 2020. 12. 9. 00:06
웹의 동작과정은 어떻게 이루어 지는가 ? 웹 브라우저에 URL을 입력한다. 클라이언트는 서버 호스트 이름을 DNS 서버에 전송하여 해당 웹 서버의 IP주소 값을 얻는다. IP 주소와 Wel-Known 포트 80번을 사용해 웹 서버와 TCP 연결을 시도한다. (이때 3-hand shake way) 방식으로 연결 TCP 연결이 설정되고 클라이언트가 서버에 GET 명령을 전송하면 서버는 요청 받은 웹 문서를 클라이언트의 웹 브라우저의 회신 서버와 클라이언트 둘 사이의 연결을 해제 한다 (4-hand shake way) 웹 브라우저는 해당 파일의 내용을 사용자가 볼 수 있게끔 화면에 표시한다. 데이터 처리 방식의 변화 구분 과거 현재 저장 관계형 데이터베이스, 데이터 웨어하우스 비관계형 데이터베이스, 가상화, ..
-
Thread (쓰레드)CS 2020. 12. 1. 15:48
Thread ? 하나의 프로세스 내부에서 독립적으로 실행되는 하나의 작업 단위를 말하며, 세부적으로는 운영체제에 의해 관리되는 하나의 작업 혹은 태스크를 의미한다. JVM에 의해 하나의 프로세스가 발생하며, Java의 Main Method 역시 하나의 흐름으로 메인 쓰레드에 해당한다. 쓰레드를 이용하면 하나의 프로세스에서도 병렬적(동시적)으로 처리가 가능하다. 여러 개의 처리 루틴을 가질 수 있다. 단순하게 반복되는 코드를 실행할 때도 여러 개의 쓰레드를 만들어서 분리 시킨 뒤 결과 데이터를 받아 합치면 그만큼 시간을 절약할 수 있다. 특히 짧은 시간 내에 많은 사용자의 트래픽을 처리해야 하는 대용량 시스템이나 CPU 활용을 극대화 시켜 처리해야 하는 복잡한 연산에서 많이 사용한다. 다중 쓰레드 작업 시..
-
캐싱?CS 2020. 11. 12. 00:17
캐시(Cache)란? 일시적으로 저장해두는 의미이자 기능이다. 캐시 메모리라 하면 실제 메모리와 CPU 사이에서 빠르게 전달을 위해 미리 데이터를 저장해두는 좀더 빠른 메모리이다. 네트워크에서 캐시는 로컬에 파일을 미리 받아놓고, 그 내용을 보거나 웹서비스에서도 매번 로딩해야 하는 파일들을 미리 로딩해두고 응답을 주기도 한다. 왜 캐시를 사용 하는가? 우리나라 기업용 웹애플리케이션은 대부분 RDBMS를 백엔드 서버로 두고 데이터 트랜잭션 위주로 운영되는 경우가 많다. 규모가 큰 사이트의 경우 성능을 위해 애플리케이션 서버나 데이터베이스 서버를 이중화 한다. 사용자가 많이 몰리면 결국 병목현상(bottleneck)이 발생하고 주로 데이터베이스인 경우가 많다고 한다. 이러한 데이터베이스의 성능을 향상하는 방..
-
Data base 2CS 2020. 8. 16. 19:20
select - 검색하고자 하는 data를 나열함 distinct - 중복행 제거 alias - 컬럼에 대해 이름 부여 from - 선택한 column의 table 위치 select ( 산술식 가능 or column명) as '별칭' ( name || '' || title) -> 컬럼들을 합성 할 수 있음 (distinct( column) ) -> 중복행 제거 order by - default 오름차순으로 정렬 ex) select * from table order by No select * from table order by No desc -> 내림차순 정렬 null값 -> 가장 큰 값으로 asc 일시 가장 맨 뒤에 desc일 시 가장 맨 뒤에. 특정 행 검색 where 절의 사용 where 절 안에 조..
-
DataBaseCS 2020. 8. 16. 18:36
1. database 구성요소 Entity(개체) - database에서 표현하고자 하는 유&무형의 객체. 서로 구별 되는 것. 단독으로 존재할 수 있으며 정보로서의 역할을 하는 것. Attribute(속성) - 개체의 특성이나 상태, 즉 개체가 가지는 세부 성질. Relationship(관계) - 개체-개체 혹은 개체-속성간의 관계 2.DBMS? DBMS Data Base Management System (데이터 베이스 관리 시스템) 데이터의 종속성, 중복성 문제를 해결하기 위해 제안된 시스템. 필수 3기능 정의 기능 - 논리적, 물리적 구조를 정의하는 기능 조작 기능 - 데이터를 검색, 갱신, 삽입, 삭제 하는 기능 제어 기능 - 정확성과 안정성을 유지하도록 제어하는 기능 RDBMS Relations..