User-Level Thread Context Inheritance for Kernel Compatibility
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
User-level threads implemented by coroutines lack compatibility with kernel-level threads due to missing functions such as thread-local variables, preemptive scheduling, and signal communication, limiting their ability to interact effectively with kernel-level threads.
Innovation Solution
A method and apparatus that create a user-level thread inheriting the context of a kernel-level thread, allowing the user-level thread to utilize the kernel-level thread's functions, including thread-local variables and signal handling, to enhance compatibility and functionality.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Productivity
If user-level threads are implemented by coroutines, then thread switching costs are reduced and customizable scheduling policies are achieved, but compatibility with kernel-level threads deteriorates due to missing functions
Solution Approach 1:
The patent merges the advantages of user-level threads (customizable scheduling, low switching costs) with the functionality of kernel-level threads by allowing user-level threads to inherit kernel-level thread contexts. This combination enables user-level threads to access thread-local variables and signal handling capabilities while maintaining efficient user-space scheduling.
Solution Approach 2:
The patent introduces a hybrid thread model that acts as an intermediary between pure user-level coroutines and kernel-level threads. This hybrid model allows user-level threads to utilize kernel-level thread contexts for functionality while being managed by user-space schedulers, bridging the gap between the two approaches.
2Adaptability or versatility
If user-level threads use coroutines, then scheduling flexibility is improved, but functional completeness deteriorates due to lack of thread-local variables and signal communication
Solution Approach 1:
The patent makes user-level threads multi-functional by enabling them to inherit kernel-level thread contexts. This allows user-level threads to perform multiple functions including accessing thread-local variables, handling signals, and maintaining customizable scheduling, thereby achieving both scheduling flexibility and functional completeness.
3Adaptability or versatility
If user-level threads inherit kernel-level thread context, then compatibility is improved, but system complexity increases due to additional thread management mechanisms
Solution Approach 1:
The patent segments thread management into two distinct layers: user-space scheduling for flexibility and kernel-space context management for functionality. This segmentation allows each layer to handle specific aspects of thread management independently, reducing overall system complexity while maintaining compatibility.
Data Source
AI summary
A computer-implemented method for thread management includes creating a first thread, where the first thread is a kernel-level thread and the first thread has a first thread context. A second thread is created through the first thread, where the second thread is a user-level thread and the second thread inherits the first thread context. After the second thread is stored in a run queue, the first thread is controller to enter an idle loop state. The second thread is selected from the run queue through a scheduling thread. The second thread is executed.


