CPU 스케쥴링 프로그램 (CPU Scheduling Program)
닫기
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
해당 자료는 7페이지 까지만 미리보기를 제공합니다.
7페이지 이후부터 다운로드 후 확인할 수 있습니다.

소개글

CPU 스케쥴링 프로그램 (CPU Scheduling Program)에 대한 보고서 자료입니다.

목차

[Test]
 [Debug]
 main.c
 node.txt
 Test.ncb
 Test.sln
 Test.suo
 Test.vcproj
 Test.vcproj.YOUR-2A76E585C4.aa.user

CPU_Scheduling_Program_Final.docx

1. 요구사항
2. 스케쥴링 알고리즘
3. 이중연결리스트
4. 자료 구조
5. 동작원리
6. 구조도
7. 실행결과
8. 프로그램 소스파일

본문내용

CPU_Scheduling_Program_Final.docx



1. Requirement

(1) Program Input Data
- 프로그램의 입력 데이터는 type, process_id, priority, computing_time의 4개 필드로 구성된다.
-type: 0은 프로세스의 생성을 나타내며, process-id, priority, computing_time을 입력 받게된다.
-type: 1은 하나의 프로세스의 시간할당량이 다되어 스케줄이 되어야 함을 나타내며, process_id, priority, computing_time의 값은 0이 되며, 특별한 의미는 없다.
-type -1은 입력 완료를 의미한다. 입력 완료 이후에는 Queue에 있는 일반 프로세스들이 우선순위에 따라 차례대로 스케줄링 된다.

(2) Process Type
- 생성되는 프로세스의 종류는 실시간 프로세스와 일반 프로세스로 구분되며, 실시간 프로세스의 priority 값은 음수가, 일반 프로세스의 priority 값은 양수가 된다.
- priority 값은 숫자가 작을수록 우선순위가 높다.
- 실시간 프로세스의 priority 값은 -1에서 -10까지 값이 할당될 수 있으며, 일반 프로세스의 priority 값은 1부터 31까지의 값이 할당될 수 있다.

(3) Scheduling Rule
- 일반 프로세스는 과제물 1에서 설계한 3개의 priority queue로 구성되는 것을 가정한다. Queue1은 priority 0에서 10까지, Queue2는 priority 11에서 20까지, Queue3는 priority 21에서 30까지가 배정된다. priority가 같은 프로세스의 경우 FIFO(First_In, First_Out)의 규칙에 따른다(먼저 생성된 프로세스의 priority가 더 높음).




▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒


main.c




#include
#include
#include

typedef struct priority_queue *queue_pointer;
struct priority_queue {
    int process_id;
    int priority;
    int computing_time;
    queue_pointer left_link, right_link;
    int input_time;
    int initial_computing_time
};

typedef struct queue_head *head_pointer;
struct queue_head {
queue_pointer link;
};

head_pointer qhead[4];
queue_pointer head, tail;
int cpu_time = 0;
const int time_quantum=20;

void initialize_queue(void);
int insert_queue(int process_id, int priority, int computing_time);
int scheduling(void);
void real_time_scheduling(int process_id, int priority, int computing_time);
//int rearrange(int process_id, int priority, int computing_time, int input_time);
int rearrange(struct priority_queue * );
void error_handling(char *message);

int main() {
    int state=0;
    int i=0, k;
    int a[15], b[14], c[14], d[14];

    
    FILE* file;
    fopen_s(&file,"node.txt", "rt+");
    if(file==NULL) {
        error_handling("File Open Error");
        return -1;
    }
        
    initialize_queue();
  • 가격3,000
  • 페이지수22페이지
  • 등록일2012.07.26
  • 저작시기2012.6
  • 파일형식압축파일(zip)
  • 자료번호#759654
본 자료는 최근 2주간 다운받은 회원이 없습니다.
청소해
다운로드 장바구니