Atomic Compare and Write Memory for Concurrency Control

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Concurrency control in multiprocessing and multithreading systems is challenging due to the computational expense and time-consuming nature of comparing the content of all memory locations before updating, which can lead to data corruption from concurrent access.

Innovation Solution

Implementing atomic compare and write memory (ACWM) instructions that allow a microcontroller to access a contiguous memory block, using a first word as a lock to conditionally write new data only if its value matches the existing value, and incrementing a counter for unsuccessful writes.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If compare and swap (CASN) operations are used to implement locks for concurrency control, then data structure protection against concurrent access is improved, but computational expense and time consumption increase

Engineering Contradiction:
Improvedata structure protectionVSAvoidtime consumption
Core Design Contradiction:
ReliabilityVSLoss of time

Solution Approach 1:

The patent segments the memory block into multiple words, with only the first word being compared and potentially updated. This segmentation allows the system to perform concurrency control on a smaller portion of data (just the first word) rather than comparing all words in the memory block, thereby reducing computational expense and time consumption while still providing effective lock protection for the entire data structure.

Inventive Principle:
Principle #1Segmentation

2Measurement precision

If all memory locations are compared before updating, then data accuracy is improved, but computational expense increases

Engineering Contradiction:
Improvedata accuracyVSAvoidcomputational expense
Core Design Contradiction:
Measurement precisionVSUse of energy by moving object

Solution Approach 1:

The patent extracts the comparison and update operation to apply only to the first word of the memory block, rather than processing all words. This extraction maintains data accuracy for the critical locking mechanism (first word) while eliminating the computational expense of comparing and potentially updating all other words in the memory block.

Inventive Principle:
Principle #2Taking out (Extraction)

3Reliability

If locks are held for longer periods, then concurrency control reliability is improved, but system productivity decreases

Engineering Contradiction:
Improveconcurrency controlVSAvoidsystem productivity
Core Design Contradiction:
ReliabilityVSProductivity

Solution Approach 1:

The patent implements dynamic lock management where the lock (first word) is updated atomically using compare and swap operations. This dynamic approach allows threads to quickly acquire and release locks without holding them for extended periods, as the atomic operations ensure that lock state changes are immediate and consistent. The dynamic nature of the atomic operations enables better thread concurrency while maintaining reliability.

Inventive Principle:
Principle #15Dynamics

Data Source

PatentUS8793438B2Atomic compare and write memory
Publication Date: 2014.07.29 NETRONOME SYSTEMS INC
  • US8793438B2 patent drawing
  • US8793438B2 patent drawing
  • US8793438B2 patent drawing

AI summary

A microcontroller system may include a microcontroller having a processor and a first memory, a memory bus and a second memory in communication with the microcontroller via the memory bus. The first memory may include instructions for accessing a first data set from a contiguous memory block in the second memory. The first data set may include a first word having a first value and a plurality of first other words. The first memory may include instructions for receiving a write instruction including a second data set to be written to the contiguous memory block. The first memory may include instructions for determining whether the first value equals the second value. If so, the first memory may include instructions for writing the second data set to the contiguous memory block and updating the first value.