{"id":4927,"date":"2019-06-12T10:05:33","date_gmt":"2019-06-12T03:05:33","guid":{"rendered":"http:\/\/de-coffee.com\/?p=4927"},"modified":"2019-06-12T10:10:55","modified_gmt":"2019-06-12T03:10:55","slug":"uu-nhuoc-diem-cac-chien-luoc-dieu-phoi","status":"publish","type":"post","link":"https:\/\/de-coffee.com\/phong-htqt-qlkh\/hoat-dong-khoa-hoc-cong-nghe\/uu-nhuoc-diem-cac-chien-luoc-dieu-phoi\/","title":{"rendered":"\u01afU NH\u01af\u1ee2C \u0110I\u1ec2M C\u00c1C CHI\u1ebeN L\u01af\u1ee2C \u0110I\u1ec0U PH\u1ed0I"},"content":{"rendered":"
\u01afU NH\u01af\u1ee2C \u0110I\u1ec2M C\u00c1C CHI\u1ebeN L\u01af\u1ee2C \u0110I\u1ec0U PH\u1ed0I CPU<\/p>\n
\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 ThS. Cao Th\u1ecb B\u00edch Li\u00ean, GV khoa C\u00f4ng ngh\u1ec7 th\u00f4ng tin<\/p>\n
Trong b\u00e0i vi\u1ebft n\u00e0y s\u1ebd tr\u00ecnh b\u00e0y v\u1ec1 chi\u1ebfn l\u01b0\u1ee3c m\u1ed9t h\u00e0ng \u0111\u1ee3i nhi\u1ec1u ti\u1ebfn tr\u00ecnh ch\u1edd ph\u00e2n ph\u1ed1i x\u1eed l\u00fd. Trong chi\u1ebfn l\u01b0\u1ee3c m\u1ed9t h\u00e0ng \u0111\u1ee3i n\u00e0y c\u00f3 4 thu\u1eadt to\u00e1n ch\u00ednh FIFO, SJF, RR, Thu\u1eadt to\u00e1n \u01b0u ti\u00ean.<\/p>\n
Trong thu\u1eadt to\u00e1n n\u00e0y, \u0111\u1ed9 \u01b0u ti\u00ean ph\u1ee5c v\u1ee5 ti\u1ebfn tr\u00ecnh c\u0103n c\u1ee9 v\u00e0o th\u1eddi \u0111i\u1ec3m h\u00ecnh th\u00e0nh ti\u1ebfn tr\u00ecnh. H\u00e0ng \u0111\u1ee3i c\u00e1c ti\u1ebfn tr\u00ecnh \u0111\u01b0\u1ee3c t\u1ed5 ch\u1ee9c theo ki\u1ec3u FIFO. M\u1ecdi ti\u1ebfn tr\u00ecnh \u0111\u1ec1u \u0111\u01b0\u1ee3c ph\u1ee5c v\u1ee5 theo tr\u00ecnh t\u1ef1 xu\u1ea5t hi\u1ec7n cho \u0111\u1ebfn khi k\u1ebft th\u00fac ho\u1eb7c b\u1ecb ng\u1eaft.<\/p>\n
V\u00ed d\u1ee5:<\/strong><\/p>\n Th\u1ee9 t\u1ef1 c\u1ea5p ph\u00e1t ti\u1ebfn tr\u00ecnh:<\/p>\n Th\u1eddi gian ch\u1edd trung b\u00ecnh: (0+23+25)\/3=16 milliseconds.<\/p>\n Gi\u1ea3i thu\u1eadt \u0111\u1ecbnh th\u1eddi lu\u00e2n phi\u00ean (round-robin scheduling algorithm-RR) \u0111\u01b0\u1ee3c thi\u1ebft k\u1ebf \u0111\u1eb7c bi\u1ec7t cho h\u1ec7 th\u1ed1ng chia s\u1ebb th\u1eddi gian. T\u01b0\u01a1ng t\u1ef1 nh\u01b0 \u0111\u1ecbnh th\u1eddi FIFO nh\u01b0ng s\u1ef1 tr\u01b0ng d\u1ee5ng CPU \u0111\u01b0\u1ee3c th\u00eam v\u00e0o \u0111\u1ec3 chuy\u1ec3n CPU gi\u1eefa c\u00e1c qu\u00e1 tr\u00ecnh. \u0110\u01a1n v\u1ecb th\u1eddi gian nh\u1ecf \u0111\u01b0\u1ee3c g\u1ecdi l\u00e0 \u0111\u1ecbnh m\u1ee9c th\u1eddi gian (time quantum) hay ph\u1ea7n th\u1eddi gian (time slice) \u0111\u01b0\u1ee3c \u0111\u1ecbnh ngh\u0129a. H\u00e0ng \u0111\u1ee3i s\u1eb5n s\u00e0ng \u0111\u01b0\u1ee3c xem nh\u01b0 m\u1ed9t h\u00e0ng \u0111\u1ee3i v\u00f2ng. B\u1ed9 \u0111\u1ecbnh th\u1eddi CPU di chuy\u1ec3n v\u00f2ng quanh h\u00e0ng \u0111\u1ee3i s\u1eb5n s\u00e0ng, c\u1ea5p ph\u00e1t CPU t\u1edbi m\u1ed7i qu\u00e1 tr\u00ecnh c\u00f3 kho\u1ea3ng th\u1eddi gian t\u1ed1i \u0111a b\u1eb1ng m\u1ed9t \u0111\u1ecbnh m\u1ee9c th\u1eddi gian. \u0110\u1ec3 c\u00e0i \u0111\u1eb7t \u0111\u1ecbnh th\u1eddi RR, ch\u00fang ta qu\u1ea3n l\u00fd h\u00e0ng \u0111\u1ee3i s\u1eb5n s\u00e0ng nh\u01b0 m\u1ed9t h\u00e0ng \u0111\u1ee3i FIFO c\u1ee7a c\u00e1c qu\u00e1 tr\u00ecnh. C\u00e1c qu\u00e1 tr\u00ecnh m\u1edbi \u0111\u01b0\u1ee3c th\u00eam v\u00e0o \u0111u\u00f4i h\u00e0ng \u0111\u1ee3i. B\u1ed9 \u0111\u1ecbnh th\u1eddi CPU ch\u1ecdn qu\u00e1 tr\u00ecnh \u0111\u1ea7u ti\u00ean t\u1eeb h\u00e0ng \u0111\u1ee3i s\u1eb5n s\u00e0ng, \u0111\u1eb7t b\u1ed9 \u0111\u1ebfm th\u1eddi gian \u0111\u1ec3 ng\u1eaft sau 1 \u0111\u1ecbnh m\u1ee9c th\u1eddi gian v\u00e0 g\u1edfi t\u1edbi qu\u00e1 tr\u00ecnh. Sau \u0111\u00f3, m\u1ed9t trong hai tr\u01b0\u1eddng h\u1ee3p s\u1ebd x\u1ea3y ra. Qu\u00e1 tr\u00ecnh c\u00f3 1chu k\u1ef3 CPU \u00edt h\u01a1n 1 \u0111\u1ecbnh m\u1ee9c th\u1eddi gian. Trong tr\u01b0\u1eddng h\u1ee3p n\u00e0y, qu\u00e1 tr\u00ecnh s\u1ebd t\u1ef1 gi\u1ea3i ph\u00f3ng. Sau \u0111\u00f3, b\u1ed9 \u0111\u1ecbnh th\u1eddi bi\u1ec3u s\u1ebd x\u1eed l\u00fd qu\u00e1 tr\u00ecnh ti\u1ebfp theo trong h\u00e0ng \u0111\u1ee3i s\u1eb5n s\u00e0ng. Ng\u01b0\u1ee3c l\u1ea1i, n\u1ebfu chu k\u1ef3 CPU c\u1ee7a qu\u00e1 tr\u00ecnh \u0111ang ch\u1ea1y d\u00e0i h\u01a1n 1 \u0111\u1ecbnh m\u1ee9c th\u1eddi gian th\u00ec \u0111\u1ed9 \u0111\u1ebfm th\u1eddi gian s\u1ebd b\u00e1o v\u00e0 g\u00e2y ra m\u1ed9t ng\u1eaft t\u1edbi h\u1ec7 \u0111i\u1ec1u h\u00e0nh. Chuy\u1ec3n \u0111\u1ed5i ng\u1eef c\u1ea3nh s\u1ebd \u0111\u01b0\u1ee3c th\u1ef1c thi v\u00e0 qu\u00e1 tr\u00ecnh \u0111\u01b0\u1ee3c \u0111\u1eb7t tr\u1edf l\u1ea1i t\u1ea1i \u0111u\u00f4i c\u1ee7a h\u00e0ng \u0111\u1ee3i s\u1eb5n s\u00e0ng. Sau \u0111\u00f3, b\u1ed9 \u0111\u1ecbnh th\u1eddi bi\u1ec3u CPU s\u1ebd ch\u1ecdn qu\u00e1 tr\u00ecnh ti\u1ebfp theo trong h\u00e0ng \u0111\u1ee3i s\u1eb5n s\u00e0ng.<\/p>\n <\/p>\n <\/p>\n <\/p>\n <\/p>\n V\u00ed d\u1ee5:<\/p>\n Quantum = 4 milliseconds<\/p>\n Th\u00ec th\u1ee9 t\u1ef1 c\u1ea5p processor cho c\u00e1c ti\u1ebfn tr\u00ecnh l\u1ea7n l\u01b0\u1ee3t l\u00e0:<\/p>\n <\/p>\n V\u1eady th\u1eddi gian ch\u1edd \u0111\u1ee3i trung b\u00ecnh s\u1ebd l\u00e0: (0+6+3+5)\/3 = 4,67 milliseconds. Nh\u01b0 v\u1eady RR c\u00f3 th\u1eddi gian ch\u1edd \u0111\u1ee3i trung b\u00ecnh nh\u1ecf h\u01a1n so v\u1edbi FIFO<\/p>\n M\u1ed9t ti\u1ebfp c\u1eadn kh\u00e1c \u0111\u1ed1i v\u1edbi vi\u1ec7c \u0111\u1ecbnh th\u1eddi CPU l\u00e0 gi\u1ea3i thu\u1eadt \u0111\u1ecbnh th\u1eddi c\u00f4ng vi\u1ec7c ng\u1eafn nh\u1ea5t tr\u01b0\u1edbc (shortest-job-first-SJF). Gi\u1ea3i thu\u1eadt n\u00e0y g\u00e1n t\u1edbi m\u1ed7i qu\u00e1 tr\u00ecnh chi\u1ec1u d\u00e0i c\u1ee7a chu k\u1ef3 CPU ti\u1ebfp theo cho qu\u00e1 tr\u00ecnh sau \u0111\u00f3. Khi CPU s\u1eb5n d\u00f9ng, n\u00f3 \u0111\u01b0\u1ee3c g\u00e1n t\u1edbi qu\u00e1 tr\u00ecnh c\u00f3 chu k\u1ef3 CPU k\u1ebf ti\u1ebfp ng\u1eafn nh\u1ea5t. N\u1ebfu hai qu\u00e1 tr\u00ecnh c\u00f3 c\u00f9ng chi\u1ec1u d\u00e0i chu k\u1ef3 CPU k\u1ebf ti\u1ebfp, \u0111\u1ecbnh th\u1eddi FIFO \u0111\u01b0\u1ee3c d\u00f9ng. Ch\u00fa \u00fd r\u1eb1ng thu\u1eadt ng\u1eef ph\u00f9 h\u1ee3p h\u01a1n l\u00e0 chu k\u1ef3 CPU k\u1ebf ti\u1ebfp ng\u1eafn nh\u1ea5t (shortest next CPU burst) v\u00ec \u0111\u1ecbnh th\u1eddi \u0111\u01b0\u1ee3c th\u1ef1c hi\u1ec7n b\u1eb1ng c\u00e1ch xem x\u00e9t chi\u1ec1u d\u00e0i c\u1ee7a chu k\u1ef3 CPU k\u1ebf ti\u1ebfp c\u1ee7a qu\u00e1 tr\u00ecnh h\u01a1n l\u00e0 to\u00e0n b\u1ed9 chi\u1ec1u d\u00e0i c\u1ee7a n\u00f3. Ch\u00fang ta d\u00f9ng thu\u1eadt ng\u1eef SJF v\u00ec h\u1ea7u h\u1ebft m\u1ecdi ng\u01b0\u1eddi v\u00e0 m\u1ecdi s\u00e1ch tham kh\u1ea3o t\u1edbi nguy\u00ean l\u00fd c\u1ee7a lo\u1ea1i \u0111\u1ecbnh th\u1eddi bi\u1ec3u n\u00e0y nh\u01b0 SJF.<\/p>\n T\u01b0\u01a1ng t\u1ef1 nh\u01b0 SJF nh\u01b0ng trong thu\u1eadt to\u00e1n n\u00e0y, \u0111\u1ed9 \u01b0u ti\u00ean th\u1ef1c hi\u1ec7n c\u00e1c ti\u1ebfn tr\u00ecnh d\u1ef1a v\u00e0o th\u1eddi gian c\u1ea7n thi\u1ebft \u0111\u1ec3 th\u1ef1c hi\u1ec7n n\u1ed1t ti\u1ebfn tr\u00ecnh (b\u1eb1ng t\u1ed5ng th\u1eddi gian tr\u1eeb \u0111i th\u1eddi gian \u0111\u00e3 th\u1ef1c hi\u1ec7n). Nh\u01b0 v\u1eady, trong thu\u1eadt to\u00e1n n\u00e0y c\u1ea7n ph\u1ea3i th\u01b0\u1eddng xuy\u00ean c\u1eadp nh\u1eadt th\u00f4ng tin v\u1ec1 gi\u1eddi gian \u0111\u00e3 th\u1ef1c hi\u1ec7n c\u1ee7a ti\u1ebfn tr\u00ecnh. \u0110\u1ed3ng th\u1eddi, ch\u1ebf \u0111\u1ed9 ph\u00e2n b\u1ed5 l\u1ea1i gi\u1edd CPU c\u0169ng ph\u1ea3i \u0111\u01b0\u1ee3c \u00e1p d\u1ee5ng n\u1ebfu kh\u00f4ng s\u1ebd l\u00e0m m\u1ea5t t\u00ecnh \u01b0u vi\u1ec7c c\u1ee7a thu\u1eadt to\u00e1n.<\/p>\n Nh\u01b0 v\u1eady, t\u00f9y thu\u1ed9c v\u00e0o t\u1eebng b\u00e0i to\u00e1n c\u1ee5 th\u1ec3 ta c\u00f3 th\u1ec3 \u00e1p d\u1ee5ng chi\u1ebfn l\u01b0\u1ee3c \u0111i\u1ec1u ph\u1ed1i n\u00e0o cho c\u00e1c ti\u1ebfn tr\u00ecnh nh\u1eb1m \u0111\u01b0a l\u1ea1i th\u1eddi gian ch\u1edd \u0111\u1ee3i \u0111\u1ec3 \u0111\u01b0\u1ee3c x\u1eed l\u00fd c\u1ee7a c\u00e1c ti\u1ebfn tr\u00ecnh m\u1ed9t c\u00e1ch nhanh nh\u1ea5t.<\/p>\n <\/p>\n <\/p>\n <\/p>\n <\/p>\n <\/p>\n <\/p>\n <\/p>\n <\/p>\n <\/p>\n <\/p>\n <\/p>\n <\/p>\n <\/p>\n <\/p>\n <\/p>\n <\/p>\n <\/p>\n <\/p>\n <\/p>\n","protected":false},"excerpt":{"rendered":" Trong m\u00f4i tr\u01b0\u1eddng \u0111a ch\u01b0\u01a1ng, c\u00f3 th\u1ec3 x\u1ea3y ra t\u00ecnh hu\u1ed1ng nhi\u1ec1u ti\u1ebfn tr\u00ecnh \u0111\u1ed3ng th\u1eddi s\u1eb5n s\u00e0ng \u0111\u1ec3 x\u1eed l\u00fd. M\u1ee5c ti\u00eau c\u1ee7a c\u00e1c h\u1ec7 ph\u00e2n chia th\u1eddi gian l\u00e0 chuy\u1ec3n \u0111\u1ed5i CPU qua l\u1ea1i gi\u1eefa c\u00e1c ti\u1ebfn tr\u00ecnh m\u1ed9t c\u00e1ch th\u01b0\u1eddng xuy\u00ean \u0111\u1ec3 nhi\u1ec1u ng\u01b0\u1eddi s\u1eed d\u1ee5ng c\u00f3 th\u1ec3 t\u01b0\u01a1ng t\u00e1c c\u00f9ng l\u00fac v\u1edbi t\u1eebng ch\u01b0\u01a1ng tr\u00ecnh trong qu\u00e1 tr\u00ecnh x\u1eed l\u00fd. \u0110\u1ec3 th\u1ef1c hi\u1ec7n \u0111\u01b0\u1ee3c m\u1ee5c ti\u00eau n\u00e0y, h\u1ec7 \u0111i\u1ec1u h\u00e0nh ph\u1ea3i l\u1ef1a ch\u1ecdn ti\u1ebfn tr\u00ecnh \u0111\u01b0\u1ee3c x\u1eed l\u00fd ti\u1ebfp theo. B\u1ed9 \u0111i\u1ec1u ph\u1ed1i s\u1ebd s\u1eed d\u1ee5ng m\u1ed9t gi\u1ea3i thu\u1eadt \u0111i\u1ec1u ph\u1ed1i (chi\u1ebfn l\u01b0\u1ee3c \u0111i\u1ec1u ph\u1ed1i) th\u00edch h\u1ee3p \u0111\u1ec3 th\u1ef1c hi\u1ec7n nhi\u1ec7m v\u1ee5 n\u00e0y nh\u1eb1m \u0111\u01b0a ra s\u1ef1 c\u00f4ng b\u1eb1ng, t\u00ednh hi\u1ec7u qu\u1ea3, th\u1eddi gian \u0111\u00e1p \u1ee9ng h\u1ee3p l\u00ed, th\u1eddi gian l\u01b0u l\u1ea1i trong h\u1ec7 th\u1ed1ng h\u1ee3p l\u00ed. <\/p>\n","protected":false},"author":21,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[49],"tags":[],"yoast_head":"\n\n\n
\n Ti\u1ebfn tr\u00ecnh<\/strong><\/td>\n Th\u1eddi \u0111i\u1ec3m v\u00e0o<\/strong><\/td>\n Th\u1eddi gian x\u1eed l\u00ed<\/strong><\/td>\n<\/tr>\n<\/thead>\n\n \n P1<\/td>\n 0<\/td>\n 24<\/td>\n<\/tr>\n \n P2<\/td>\n 1<\/td>\n 3<\/td>\n<\/tr>\n \n P3<\/td>\n 2<\/td>\n 3<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n \n\n
\n \nTi\u1ebfn tr\u00ecnh<\/td>\n P1<\/td>\n P2<\/td>\n P3<\/td>\n<\/tr>\n<\/thead>\n \n Th\u1eddi \u0111i\u1ec3m<\/td>\n 0<\/td>\n 24<\/td>\n 27\/30<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n \n
\n
\n
\n\n
\n Ti\u1ebfn tr\u00ecnh<\/strong><\/td>\n th\u1eddi \u0111i\u1ec3m v\u00e0o<\/strong><\/td>\n th\u1eddi gian x\u1eed l\u00fd<\/strong><\/td>\n<\/tr>\n<\/thead>\n\n \n P1<\/td>\n 0<\/td>\n 24<\/td>\n<\/tr>\n \n P2<\/td>\n 1<\/td>\n 3<\/td>\n<\/tr>\n \n P3<\/td>\n 2<\/td>\n 3<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n \n\n
\n Ti\u1ebfn tr\u00ecnh<\/strong><\/td>\n P1<\/strong><\/td>\n P2<\/strong><\/td>\n P3<\/strong><\/td>\n P1<\/strong><\/td>\n P1<\/strong><\/td>\n P1<\/strong><\/td>\n P1<\/strong><\/td>\n P1<\/strong><\/td>\n P1<\/strong><\/td>\n<\/tr>\n<\/thead>\n\n \n Th\u1eddi \u0111i\u1ec3m<\/td>\n 0<\/td>\n 4<\/td>\n 7<\/td>\n 10<\/td>\n 14<\/td>\n 18<\/td>\n 22<\/td>\n 26<\/td>\n 30<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n \n
\n
\n
\n
\n
\n
\n
\n
<\/a>III. K\u1ebft lu\u1eadn<\/h1>\n
C. T\u00e0i li\u1ec7u tham kh\u1ea3o<\/h1>\n[1]. H\u1ed3 \u0110\u1eafc Ph\u01b0\u01a1ng (2010), Nguy\u00ean l\u00fd h\u1ec7 \u0111i\u1ec1u h\u00e0nh, NXB Gi\u00e1o d\u1ee5c.<\/p>\n[2]. T\u1eeb Minh Ph\u01b0\u01a1ng (2013), Gi\u00e1o tr\u00ecnh h\u1ec7 \u0111i\u1ec1u h\u00e0nh, NXB, H\u1ecdc vi\u1ec7n c\u00f4ng ngh\u1ec7 B\u01b0u ch\u00ednh Vi\u1ec5n th\u00f4ng.<\/p>\n[3]. Nguy\u1ec5n Kim Tu\u1ea5n (2014), Gi\u00e1o tr\u00ecnh l\u00fd thuy\u1ebft h\u1ec7 \u0111i\u1ec1u h\u00e0nh, NXB \u0110HQGHN.<\/p>\n[4]. H\u00e0 Quang Th\u1ee5y (2009), Gi\u00e1o tr\u00ecnh Nguy\u00ean l\u00fd h\u1ec7 \u0111i\u1ec1u h\u00e0nh, NXB Khoa h\u1ecdc v\u00e0 k\u1ef9 thu\u1eadt<\/p>\n