处理异步任务的方法及装置
By using thread-local storage variables and thread identifiers in the asynchronous task thread pool to dynamically match threads in the pool to execute asynchronous tasks, the problem of low execution efficiency of the thread pool is solved, and more efficient task processing is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- 武汉斗鱼鱼乐网络科技有限公司
- Filing Date
- 2020-06-26
- Publication Date
- 2026-07-17
AI Technical Summary
Existing asynchronous task thread pools suffer from low execution efficiency, and the use of different threads for task submission and execution leads to high overhead from thread switching and context switching.
The current thread submitting the asynchronous task is determined by creating a thread-local storage variable in the thread pool. The current thread is then used to execute the task if it belongs to the thread pool based on the thread identifier. Otherwise, the target thread is determined from the thread pool and matched with the task type and the data value of each thread in the thread pool, thus avoiding unnecessary thread creation and switching.
It improves the execution efficiency of asynchronous tasks, reduces the overhead of thread switching and context switching, saves resources, and ensures that tasks are matched with suitable threads for processing.
Smart Images

Figure CN113849279B_ABST