1. Trang chủ
  2. » Công Nghệ Thông Tin

Thực hành hệ điều hành

124 25 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Nội dung

T Biên www hutech edu vn 1 2018 COS318 tailieuhoctaphutech edu vn I I IV BÀI 1 1 1 2 4 4 6 6 TRÌNH 7 1 4 7 7 7 8 1 4 8 9 10 14 14 14 14 15 2 16 20 24 24 27 27 30 30 31 34 34 system 34 exec 35 fork. ......................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................

T Biên www.hutech.edu.vn *1.2018.COS318* tailieuhoctap@hutech.edu.vn : I I IV BÀI 1: .6 TRÌNH 1.4 1.4 10 14 14 14 14 15 16 20 24 24 27 27 30 30 31 34 34 system 34 exec 35 fork 36 37 II 38 44 5.1 KHÁI QUÁT 44 44 44 45 45 46 46 46 47 47 49 59 KET 59 6.1.1 Socket 59 59 6.2 CÁCH SOCKET LÀM 6.2 64 64 66 67 68 6.2 69 69 69 70 ÌNH KHÁCH 73 78 78 78 78 79 79 7.2.1 Bài 79 7.2.2 Bài 81 7.2.3 Bài 82 86 X 86 8.1.1 Mutex 86 86 8.1.3 Khóa tháo khóa cho mutex 87 III 88 88 I SEMAPHORE 92 8.2.1 Semaphore ? 92 92 95 98 98 98 98 -job-first SJF) 101 105 109 10.1 G UNIX VÀ LINUX 109 109 109 111 114 115 IV Máy Tính tin tên Bài Trình b , Bài 5: GIAO Trình bày V Bài 6: Trình bày Bài 7: Bài 8: Bài 9: Trình bày cá Sinh v , VI - - 50% 50% BÀI 1: QUAN BÀI 1: T 1.1 CÁC KHÁI NI N - - - - truy - i dir2 - BÀI 1: QUAN - process id) - 1.2 M T S L command N h command - help man command ls ls a ls l (file) cd path path cd ~ cd cd hành cp cp destination_path mkdir source_path 102 BÀI 9: CPU bool check = false; // Process until all processes gets // completed while (complete != n) { // Find process with minimum // remaining time among the // processes that arrives till the // current time` for (int j = 0; j < n; j++) { if ((proc[j].art 0) { minm = rt[j]; shortest = j; check = true; } } if (check == false) { t++; continue; } // Reduce remaining time by one rt[shortest] ; // Update minimum minm = rt[shortest]; if (minm == 0) minm = INT_MAX; // If a process gets completely // executed if (rt[shortest] == 0) { // Increment complete complete++; check = false; // Find finish time of current BÀI 9: CPU 103 // process finish_time = t + 1; // Calculate waiting time wt[shortest] = finish_time proc[shortest].bt proc[shortest].art; if (wt[shortest] < 0) wt[shortest] = 0; } // Increment time t++; } } // Function to calculate turn around time void findTurnAroundTime(Process proc[], int n, int wt[], int tat[]) { // calculating turnaround time by adding // bt[i] + wt[i] for (int i = 0; i < n; i++) tat[i] = proc[i].bt + wt[i]; } // Function to calculate average time void findavgTime(Process proc[], int n) { int wt[n], tat[n], total_wt = 0, total_tat = 0; // Function to find waiting time of all // processes findWaitingTime(proc, n, wt); // Function to find turn around time for // all processes findTurnAroundTime(proc, n, wt, tat); // Display processes along with all // details 104 BÀI 9: CPU cout

Ngày đăng: 25/10/2022, 00:31

TÀI LIỆU CÙNG NGƯỜI DÙNG

TÀI LIỆU LIÊN QUAN