Store Queue Membar Token for Thread Synchronization
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing store queue designs experience performance issues due to the need to drain all preceding stores before inserting a new store when a membar instruction is encountered, which can hinder system performance under strong memory models.
Innovation Solution
Implementing a store queue system that uses a membar token and an unacknowledged counter to manage store operations, allowing stores to be committed only after all preceding stores have been acknowledged, and enabling the processor to continue executing new code without draining the store queue.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If the system waits for all preceding stores to drain from the store queue before inserting a new store during a membar instruction, then memory consistency is maintained, but system performance deteriorates
Solution Approach 1:
The invention segments the store queue management by introducing a special membar token entry that separates the synchronization function from regular store operations. This token divides the queue into preceding stores (before membar) and subsequent stores (after membar), allowing independent handling of each segment while maintaining overall memory consistency.
Solution Approach 2:
The membar token acts as an intermediary element in the store queue that mediates between the requirement for memory consistency and the need for continuous store insertion. The token tracks acknowledgment status of preceding stores through an unacknowledged counter, enabling subsequent stores to be inserted without waiting for complete draining of the queue.
2Reliability
If the processor waits for store queue draining during membar operations, then proper synchronization is achieved, but execution continuity is hindered
Solution Approach 1:
The system performs preliminary actions by inserting the membar token into the store queue before waiting for acknowledgments. This allows the processor to continue executing and inserting subsequent stores while the token independently tracks the acknowledgment status of preceding stores, eliminating the need to halt execution during membar operations.
Solution Approach 2:
The invention maintains continuity of useful action by allowing the processor to continue inserting stores into the store queue even during membar operations. The membar token manages the synchronization requirement in the background while the processor executes instructions continuously, preventing execution delays.
3Productivity
If stores are pipelined without waiting for acknowledgments, then system performance improves, but memory model compliance becomes difficult to enforce
Solution Approach 1:
The system implements feedback through the unacknowledged counter that continuously monitors the number of preceding stores awaiting acknowledgment. This feedback mechanism allows the processor to pipeline stores efficiently while the membar token receives updates on acknowledgment status, ensuring memory model compliance when required.
Solution Approach 2:
The membar token serves as an intermediary that decouples the pipelining of stores from the enforcement of memory model compliance. Subsequent stores can be pipelined and inserted into the queue without waiting for acknowledgments, while the token independently enforces the memory model requirements by controlling when the synchronization point is reached.
Data Source
AI summary
Some embodiments of the present invention provide a system for operating a store queue, wherein the store queue buffers stores that are waiting to be committed to a memory system in a processor. During operation, the system examines an entry at the head of the store queue. If the entry contains a membar token, the system examines an unacknowledged counter that keeps track of the number of store operations that have been sent from the store queue to the memory system but have not been acknowledged as being committed to the memory system. If the unacknowledged counter is non-zero, the system waits until the unacknowledged counter equals zero, and then removes the membar token from the store queue.


