Exclusive Task Scheduling in Database Worker Threads
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing database systems face challenges in efficiently managing exclusive memory access requirements during query execution, leading to potential bottlenecks and reduced performance.
Innovation Solution
The method involves executing a query execution plan, setting flags to control worker threads, and utilizing a second queue for exclusive tasks within the memory stack, ensuring exclusive memory access and efficient task execution.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Productivity
If multiple worker threads execute tasks from a shared queue concurrently, then productivity is improved through parallel processing, but memory access conflicts occur reducing reliability
Solution Approach 1:
The patent segments the single shared task queue into multiple separate queues (first queue for non-exclusive tasks, second queue for exclusive tasks). Worker threads are assigned to process tasks from specific queues based on exclusivity requirements, eliminating memory access conflicts while maintaining parallel processing productivity.
2Reliability
If exclusive tasks are scheduled separately from non-exclusive tasks, then memory access reliability is improved, but device complexity increases due to multiple queues and flag management
Solution Approach 1:
The patent merges the management of multiple queues and worker threads under a single task scheduler that uses flag-based control. The first flag and second flag provide unified control mechanisms for switching between processing non-exclusive and exclusive tasks, reducing the complexity of managing separate scheduling systems while ensuring reliable exclusive memory access.
3Reliability
If worker threads stop executing tasks to allow exclusive memory access, then exclusive scheduling reliability is improved, but productivity decreases due to task execution pauses
Solution Approach 1:
The patent maintains continuity of useful action by having worker threads continuously process tasks from appropriate queues. When exclusive tasks require memory access, threads transition to processing from the second queue rather than stopping entirely. The flag mechanism enables seamless switching between queues, ensuring continuous productive work while guaranteeing exclusive memory access when required.
Data Source
AI summary
In some implementations, there is provided executing a query execution plan for a query; setting a first flag to indicate to a plurality of worker threads to stop executing tasks in a first queue of a memory stack; pushing into the memory stack, a second queue containing one or more exclusive tasks associated with the query; setting a second flag to indicate to the plurality of worker threads to resume working; and in response to the second queue being empty of the one or more exclusive tasks, setting a third flag to indicate to the plurality of worker threads to stop executing tasks in the second queue, and setting a fourth flag to indicate to the plurality of worker threads to resume working on the tasks in the first queue.


