Author:
Zeceng Song,Weizhong Qian
Abstract
Abstract
In embedded operating systems, how to ensure thread tasks execute in order of priority is an important issue. Considering that thread may have child threads, and child threads are scheduled by their parent thread, so they also need to be executed accroding to their priorities. For such two-level scheduling issue, this paper proposes a new scheduling policy: parent thread uses the table-driven scheduling policy, and child thread uses the fixed priority scheduling policy to ensure the orderly execution of both parent and child threads. In order to cooperate with the implementation of two-level scheduling, this paper also realizes the creation of child threads in an embedded operating system by imitating Linux thread replication, connects the parent and child threads through pointers, and realizes a priority queue of child threads in their parent thread. In addition, by saving the ID of current executing child thread into the stack of corresponding parent thread, this paper ensures that parent thread can recover its last executing child thread after several switches of parent threads. Several experiments on 2440 single core development board showed that method proposed by this paper could realize the creation of sub threads and two-level thread scheduling in embedded operating system.
Subject
General Physics and Astronomy