Final answer:
EDF scheduling considers the execution time, deadline, and period of threads to determine utilization and context switching. The maximum CPU time for each process includes the execution time and context-switch delays. Precise figures require the scheduling diagram and LCM calculation.
Step-by-step explanation:
To understand the scheduling of threads T1 and T2 using the Earliest Deadline First (EDF) preemptive scheduling algorithm, we must consider the execution time, deadline, and period of both threads.
Thread T1 has an Execution time of 20 ms, Deadline of 35 ms, and Period of 40 ms. Thread T2, which activates at 10 ms, has an Execution time of 10 ms, Deadline of 20 ms, and Period of 60 ms. Context switching takes an additional 5 ms.
To calculate the utilization, we use the sum of the execution times of both threads divided by the least common multiple (LCM) of their periods. This gives an understanding of the amount of time the processor is actively working on the threads.
The maximum CPU time for each process considers the execution time plus any context-switching delays. Since T2 has a more urgent deadline when it arrives at 10 ms, T1 will be preempted to allow T2 to execute, incurring a context switch.
Both threads can meet their deadlines if the total utilization does not exceed 100%. In this scenario, context switching occurs whenever a thread is preempted for the other to meet its deadline. The precise calculation for the number of context switches and maximum CPU time for each process depends on the calculated LCM and the resulting scheduling diagram which lays out the exact execution pattern.
Unfortunately, without the specific calculation of the LCM and without drawing the scheduling diagram, it is not possible to give exact figures for utilization, number of context switches, or maximum CPU time.