Font Size: a A A

Research On The Context Switching Method In Preempitive Real-Time System

Posted on:2011-10-14Degree:MasterType:Thesis
Country:ChinaCandidate:X L CaiFull Text:PDF
GTID:2248330395457699Subject:Computer system architecture
Abstract/Summary:PDF Full Text Request
As RTOS(Real-Time Operating System) is being widely used, it attracts more and more attentions. RTOS, according to its work patterns, can be divided into preemptive scheduling and non-preemptive scheduling. The context switching happens when the task finished, canceled, or waiting for messages in the non-preemptive scheduling. The context switching also occurs when the task being activated in the preemptive scheduling in order to fast-response the new high priority task. Consequently, the context switching is inevitable. It allows multiple tasks at execution simultaneously to share the only one processor.Because possessing the huge superiority of the best utilization of the CPU and fast-response the new task, the preemptive scheduling method is supported by most of the real-time kernel. While very useful, context switching also introduces high performance overheads, which involves saving and restoring the task states. The preemption of the preemptive scheduling takes no account of the current running task’s state. If the running task is nearly finished and the new one isn’t urgency, as the new task’s preemption, the current task will be delayed and could have missed its deadline, so the RTOS increase the amount of context switching and waste CPU resource. While in the non-preemptive kernel, if the scheduling is at a suitable time, the RTOS will run smoothly, have better CPU’s utilization and less overheads. In accordance with the above case, this paper considers "Tasks Set Achievement Relaxation Time" and "Max Protected Time", both modify the scheduling time considering the priority as primary factor, while the "Max Protected Time" is supplementary. That is to say, when the running task’s remaining execution time less than its protected time, the context switching will not be happened. On the contrary, the RTOS will compare the task’s priority of ready list, and choose the highest one to schedule.Finally, the author writes two preemptive scheduling simulations, one based on priority, and another one according to this paper’s novel algorithm. Subsequently, we have done a number of experimentations. Experimental results show that the novel algorithm apparently decreased the number of the context switching and all the tasks have a valuable result in each deadline.
Keywords/Search Tags:Real-Time Operating System, Preemptive Kernel, Non-preemptive Kernel, Context Switching, Protected Time
PDF Full Text Request
Related items