摘要 |
In embodiments of the present invention, after receiving a hardware thread reservation request, an operating system loads a task code to a reserved hardware thread so that the reserved hardware thread executes the task code subsequently. Alternatively, in a process in which an operating system loads a task code to a hardware thread for execution, when the hardware thread reads a flag of a small task code, the hardware thread loads the small task code to a reserved hardware thread for execution without a need to create a thread for a task code corresponding to each task. Compared with solutions in the prior art in which an operating system creates a thread for a task code corresponding to each task during execution of the task code in the thread, and releases the corresponding thread after the task code corresponding to the task is executed, solutions in the embodiments of the present invention substantially reduce system overheads and improve system resource utilization, especially when a task includes a large number of small tasks. |