5 CHAPTERCPU SchedulingPractice Exercises5.1 A CPU scheduling algorith dịch - 5 CHAPTERCPU SchedulingPractice Exercises5.1 A CPU scheduling algorith Việt làm thế nào để nói

5 CHAPTERCPU SchedulingPractice Exe

5 CHAPTER
CPU Scheduling
Practice Exercises
5.1 A CPU scheduling algorithmdetermines an order for the execution of its
scheduled processes. Given n processes to be scheduled on one proces-
sor, how many possible different schedules are there? Give a formula in
terms of n.
Answer: n! (n factorial = n × n –1 × n –2 × ... × 2 × 1).
5.2 Define the difference between preemptive and nonpreemptive schedul-
ing.
Answer: Preemptive scheduling allows a process to be interrupted
in the midst of its execution, taking the CPU away and allocating it
to another process. Nonpreemptive scheduling ensures that a process
relinquishes control of the CPU only when it finishes with its current
CPU burst.
5.3 Suppose that the following processes arrive for execution at the times
indicated. Each process will run the listed amount of time. In answering
the questions, use nonpreemptive scheduling and base all decisions on
the information you have at the time the decision must be made.
Process Arrival Time Burst Time
P1 0.0 8
P2 0.4 4
P3 1.0 1
a. What is the average turnaround time for these processes with the
FCFS scheduling algorithm?
1314 Chapter 5 CPU Scheduling
b. Whatistheaverageturnaroundtimefortheseprocesseswiththe
SJF scheduling algorithm?
c. The SJF algorithmis supposed to improve performance, but notice
thatwe chose to run process P1 at time 0 becausewe did not know
that two shorter processes would arrive soon. Compute what the
average turnaround timewill be if the CPU is left idle for the first 1
unit and then SJF scheduling is used. Remember that processes P1
and P2 arewaiting during this idle time, so theirwaiting timemay
increase. This algorithm could be known as future-knowledge
scheduling.
Answer:
a. 10.53
b. 9.53
c. 6.86
Remember that turnaround time is finishing time minus arrival time, so
you have to subtract the arrival times to compute the turnaround times.
FCFS is 11 if you forget to subtract arrival time.
5.4 What advantage is there in having different time-quantum sizes on dif-
ferent levels of a multilevel queueing system?
Answer: Processes that need more frequent servicing, for instance,
interactive processes such as editors, can be in a queuewith a small time
quantum. Processeswith no need for frequent servicing can be in a queue
with a larger quantum, requiring fewer context switches to complete the
processing, and thus making more efficient use of the computer.
5.5 Many CPU-scheduling algorithms are parameterized. For example, the
RR algorithm requires a parameter to indicate the time slice. Multilevel
feedback queues require parameters to define the number of queues,
the scheduling algorithms for each queue, the criteria used to move
processes between queues, and so on.
These algorithms are thus really sets of algorithms (for example, the
set of RR algorithms for all time slices, and so on). One set of algorithms
may include another (for example, the FCFS algorithmis the RR algorithm
with an infinite time quantum).What (if any) relation holds between the
following pairs of sets of algorithms?
a. Priority and SJF
b. Multilevel feedback queues and FCFS
c. Priority and FCFS
d. RR and SJF
Answer:
a. The shortest job has the highest priority.
b. The lowest level of MLFQ is FCFS.Practice Exercises 15
c. FCFS gives the highest priority to the job having been in existence
the longest.
d. None.
5.6 Suppose that a scheduling algorithm (at the level of short-term CPU
scheduling) favors those processes that have used the least processor
time in the recent past. Why will this algorithm favor I/O-bound pro-
grams and yet not permanently starve CPU-bound programs?
Answer: It will favor the I/O-bound programs because of the relatively
short CPU burst request by them; however, the CPU-bound programs
will not starve because the I/O-bound programs will relinquish the CPU
relatively often to do their I/O.
5.7 Distinguish between PCS and SCS scheduling.
Answer: PCS scheduling is done local to the process. It is how the
thread library schedules threads onto available LWPs. SCS scheduling is
the situation where the operating system schedules kernel threads. On
systems using eithermany-to-one ormany-to-many, the two scheduling
models are fundamentally different. On systems using one-to-one, PCS
and SCS are the same.
5.8 Assume an operating systemmaps user-level threads to the kernel using
the many-to-many model where the mapping is done through the use
of LWPs. Furthermore, the system allows program developers to create
real-time threads. Is it necessary to bind a real-time thread to an LWP?
Answer: Yes, otherwise a user thread may have to compete for an
available LWP prior to being actually scheduled. By binding the user
thread to an LWP, there is no latency while waiting for an available LWP;
the real-time user thread can be scheduled immediately.
0/5000
Từ: -
Sang: -
Kết quả (Việt) 1: [Sao chép]
Sao chép!
5 CHƯƠNGCPU lập kế hoạchBài tập thực hành5.1 một CPU lập kế hoạch algorithmdetermines một đơn đặt hàng cho việc thực hiện của nóquy trình theo lịch trình. Cho n quy trình để được sắp xếp vào một xử-Sor, bao nhiêu lịch trình có thể khác nhau không? Cung cấp cho một công thức trongđiều khoản của n.Trả lời: n! (giai thừa n = n × n –1 × n –2 ×... × 2 × 1).5.2 Define sự khác biệt giữa "phòng ngừa" và nonpreemptive schedul-ing.Trả lời: Lập kế hoạch "phòng ngừa" cho phép một quá trình để bị gián đoạnở giữa thực hiện nó, lấy CPU đi và phân bổ nóđể một tiến trình khác. Lập kế hoạch nonpreemptive đảm bảo rằng một quá trìnhrelinquishes kiểm soát của CPU chỉ khi nó finishes với hiện tại của nóCPU burst.5.3 giả sử rằng các quá trình sau đây đến để thực hiện tại thời gianchỉ ra. Mỗi quá trình sẽ chạy khoảng thời gian, được liệt kê. Trả lờiCác câu hỏi, sử dụng lập kế hoạch nonpreemptive và cơ sở tất cả các quyết định trênnhững thông tin bạn có lúc đó quyết định phải được thực hiện.Quá trình thời gian Burst đến thời gianP1 0.0 8P2 CÁCH 0.4 4P3 1.0 1a. những gì là thời gian quay vòng trung bình cho các quá trình này với cácFCFS thuật toán lập lịch trình?1314 chương 5 CPU lập kế hoạchsinh WhatistheaverageturnaroundtimefortheseprocesseswiththeSJF thuật toán lập lịch trình?c. algorithmis SJF phải cải thiện hiệu suất, nhưng thông báomà đã chọn để chạy quá trình P1 lúc thời gian 0 becausewe không biếtrằng hai quá trình ngắn hơn sẽ đến sớm. Tính toán những gì cácaverage turnaround timewill be if the CPU is left idle for the first 1unit and then SJF scheduling is used. Remember that processes P1and P2 arewaiting during this idle time, so theirwaiting timemayincrease. This algorithm could be known as future-knowledgescheduling.Answer:a. 10.53b. 9.53c. 6.86Remember that turnaround time is finishing time minus arrival time, soyou have to subtract the arrival times to compute the turnaround times.FCFS is 11 if you forget to subtract arrival time.5.4 What advantage is there in having different time-quantum sizes on dif-ferent levels of a multilevel queueing system?Answer: Processes that need more frequent servicing, for instance,interactive processes such as editors, can be in a queuewith a small timequantum. Processeswith no need for frequent servicing can be in a queuewith a larger quantum, requiring fewer context switches to complete theprocessing, and thus making more efficient use of the computer.5.5 Many CPU-scheduling algorithms are parameterized. For example, theRR algorithm requires a parameter to indicate the time slice. Multilevelfeedback queues require parameters to define the number of queues,the scheduling algorithms for each queue, the criteria used to moveprocesses between queues, and so on.These algorithms are thus really sets of algorithms (for example, theset of RR algorithms for all time slices, and so on). One set of algorithmscó thể bao gồm một (cho ví dụ, các FCFS algorithmis RR thuật toánvới một infinite thời gian lượng tử). Những gì (nếu có) nắm giữ mối quan hệ giữa cáccặp sau đây của bộ của thuật toán?a. ưu tiên và SJFsinh thông tin phản hồi đa hàng đợi và FCFSc. ưu tiên và FCFSmất RR và SJFTrả lời:a. công việc ngắn nhất có ưu tiên cao nhất.sinh mức thấp nhất của MLFQ là FCFS. 15 bài tậpc. FCFS cho ưu tiên cao nhất cho công việc có trong sự tồn tạidài nhất.mất không.5,6 giả sử rằng một thuật toán lập lịch trình (ở cấp độ của ngắn hạn CPUlập kế hoạch) ủng hộ những quy trình có sử dụng bộ xử lý ít nhấtthời gian trong quá khứ gần đây. Tại sao sẽ thuật toán này ưu tiên tôi/O-bound pro -gram và được vĩnh viễn không đói CPU-bound chương trình?Trả lời: Nó sẽ ưu tiên các chương trình I/O-bound vì các tương đốingắn CPU burst yêu cầu của họ; Tuy nhiên, các chương trình CPU-ràng buộcsẽ không chết đói bởi vì chương trình I/O-bound sẽ từ bỏ CPUtương đối thường xuyên để làm của I/O.5.7 phân biệt giữa máy tính và SCS lập kế hoạch.Trả lời: Máy tính cá nhân lập lịch trình được thực hiện cục bộ quá trình. Nó là như thế nào cácchủ đề thư viện lịch trình chủ đề vào có sẵn LWPs. SCS lập kế hoạch làtình hình nơi hệ điều hành lịch chủ đề của hạt nhân. NgàyHệ thống bằng cách sử dụng một eithermany ormany đến rất nhiều, cả hai lập kế hoạchMô hình là cơ bản khác nhau. Trên hệ thống bằng cách sử dụng một trong-một, máy tính cá nhânvà SCS đều giống nhau.5.8 giả định một systemmaps hoạt động cấp độ người dùng chủ đề để sử dụng hạt nhânCác mô hình nhiều cho rất nhiều nơi ánh xạ được thực hiện thông qua việc sử dụngcủa LWPs. Hơn nữa, Hệ thống cho phép nhà phát triển chương trình để tạo rachủ đề của thời gian thực. Nó là cần thiết để liên kết một chủ đề thời gian thực với một LWP?Trả lời: Có, nếu không một chủ đề người sử dụng có thể có để cạnh tranh cho mộtcó LWP trước khi thực sự đang được lên kế hoạch. Bởi ràng buộc người sử dụngchủ đề để LWP một, có là không có độ trễ trong khi chờ đợi một LWP có sẵn;Các chủ đề người sử dụng thời gian thực có thể được sắp xếp ngay lập tức.
đang được dịch, vui lòng đợi..
 
Các ngôn ngữ khác
Hỗ trợ công cụ dịch thuật: Albania, Amharic, Anh, Armenia, Azerbaijan, Ba Lan, Ba Tư, Bantu, Basque, Belarus, Bengal, Bosnia, Bulgaria, Bồ Đào Nha, Catalan, Cebuano, Chichewa, Corsi, Creole (Haiti), Croatia, Do Thái, Estonia, Filipino, Frisia, Gael Scotland, Galicia, George, Gujarat, Hausa, Hawaii, Hindi, Hmong, Hungary, Hy Lạp, Hà Lan, Hà Lan (Nam Phi), Hàn, Iceland, Igbo, Ireland, Java, Kannada, Kazakh, Khmer, Kinyarwanda, Klingon, Kurd, Kyrgyz, Latinh, Latvia, Litva, Luxembourg, Lào, Macedonia, Malagasy, Malayalam, Malta, Maori, Marathi, Myanmar, Mã Lai, Mông Cổ, Na Uy, Nepal, Nga, Nhật, Odia (Oriya), Pashto, Pháp, Phát hiện ngôn ngữ, Phần Lan, Punjab, Quốc tế ngữ, Rumani, Samoa, Serbia, Sesotho, Shona, Sindhi, Sinhala, Slovak, Slovenia, Somali, Sunda, Swahili, Séc, Tajik, Tamil, Tatar, Telugu, Thái, Thổ Nhĩ Kỳ, Thụy Điển, Tiếng Indonesia, Tiếng Ý, Trung, Trung (Phồn thể), Turkmen, Tây Ban Nha, Ukraina, Urdu, Uyghur, Uzbek, Việt, Xứ Wales, Yiddish, Yoruba, Zulu, Đan Mạch, Đức, Ả Rập, dịch ngôn ngữ.

Copyright ©2025 I Love Translation. All reserved.

E-mail: