Skip to content

平成22年度 春期 ITパスポート試験 問76

This question's explanation and your answers so far.

問76
頻出度★☆☆

OS が, ジョブを到着順に, 前のジョブが終わってから次のジョブを処理する場合について考える。ジョブの到着時刻と処理時間が表のとおりであるとき, ジョブ 4 は, 到着してからその処理が終了するまでに何秒を要するか。ここで, 四つのジョブ以外の処理に要する時間は無視できるものとする。表の到着時刻は, ジョブ 1 が到着した時刻を開始時刻とする。

到着時刻処理時間
ジョブ10秒後3秒
ジョブ24秒後4秒
ジョブ35秒後3秒
ジョブ47秒後5秒
出典 平成22年度 春期 ITパスポート試験 問76
解説

問 76

  • Incorrectア

    5 is nothing but job 4's own processing time. The question asks for the time from arrival until processing finishes (the turnaround time), and this value does not count the 4 seconds that job 4 spends waiting for the earlier jobs after it arrives.

  • Incorrectイ

    8 is the value you get if you overlook the idle time between 3 and 4 seconds and wrongly assume that job 2 starts at 3 seconds, immediately after job 1 finishes (job 2 from 3 to 7, job 3 from 7 to 10, job 4 from 10 to 15, giving 15−7=8). Job 2 does not arrive until 4 seconds, so it cannot start at 3 seconds.

  • ウ

    正解 Jobs are handled in order of arrival (first-come, first-served), and the next job is processed only after the previous one has finished, so the execution timeline is as follows. Job 1 arrives at 0 seconds and starts right away, running from 0 to 3 seconds. Job 2 does not arrive until 4 seconds, so it does not start at 3 seconds when the CPU becomes free; it starts at 4 seconds and runs from 4 to 8 seconds (between 3 and 4 seconds there is no waiting job, so the CPU is idle). Job 3 has already arrived at 5 seconds, but it must wait for job 2 to finish, so it runs from 8 to 11 seconds. Job 4 has already arrived at 7 seconds, but it must wait for job 3 to finish, so it runs from 11 to 16 seconds. Therefore job 4 needs 16−7=9 seconds from its arrival (at 7 seconds) until it finishes (at 16 seconds). The same value is obtained by adding the waiting time of 4 seconds (the remaining 1 second of job 2 plus the 3 seconds of job 3) and its own processing time of 5 seconds. Hence the correct answer is ウ.

  • Incorrectエ

    12 comes from treating job 4's waiting time as the sum of the processing times of job 2 and job 3, 4+3=7 seconds, and then calculating 7+5=12. At the moment job 4 arrives (7 seconds), job 2 has already been running for 3 seconds, so the actual wait is only the remaining 1 second of job 2 plus the 3 seconds of job 3, 4 seconds in total.

ここがポイント
  • Turnaround time = waiting time + processing time. It is the elapsed time from the moment a job arrives until its processing finishes, not just the processing time.
  • In non-preemptive processing by order of arrival (FCFS), a job that has not arrived yet cannot run even when the CPU is free, so idle time appears. The sure way is to draw a timeline (time chart) and fix the start time and end time of each job one by one.
用語

Your answers