Automatic Mutual Exclusion for Concurrent Shared Memory

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Concurrent programming faces challenges in effectively managing shared memory, leading to issues like race conditions and incorrect results, even for experienced programmers, due to the difficulty in properly employing synchronization mechanisms, which can result in poor performance or incorrect results as programs evolve.

Innovation Solution

An automatic mutual exclusion programming model that uses asynchronous methods and transactional memory to ensure serialized execution and synchronization of shared memory, allowing for concurrent execution while maintaining reversibility of changes, thus simplifying the creation of correctly synchronized concurrent programs.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If traditional shared memory management mechanisms (mutex, locks, semaphores) are used to synchronize threads, then thread synchronization and correctness are improved, but program complexity and difficulty of implementation increase significantly

Engineering Contradiction:
Improvethread synchronization correctnessVSAvoidprogram complexity
Core Design Contradiction:
ReliabilityVSDevice complexity

Solution Approach 1:

The patent introduces an intermediary mechanism (transactional memory system) that mediates between threads and shared memory. This intermediary automatically handles synchronization by recording transactions in a log and verifying consistency, eliminating the need for programmers to directly manage complex mutex, locks, or semaphores while ensuring thread synchronization correctness.

Inventive Principle:
Principle #24Intermediary (Mediator)

Solution Approach 2:

The transactional memory system enables threads to perform self-service synchronization. Each thread automatically records its memory transactions in a log and verifies consistency with other threads' transactions. The system autonomously detects conflicts and manages commit/abort decisions without requiring external synchronization primitives, reducing program complexity.

Inventive Principle:
Principle #25Self-service

2Productivity

If shared memory is accessed by multiple concurrent threads to improve execution efficiency, then program performance is improved, but race conditions and incorrect results may occur

Engineering Contradiction:
Improveexecution efficiencyVSAvoidcorrectness of results
Core Design Contradiction:
ProductivityVSReliability

Solution Approach 1:

The patent implements a feedback mechanism through transactional memory logs. Each thread's memory transactions are recorded and continuously monitored. When conflicts are detected through log verification, the system provides feedback by aborting inconsistent transactions and retrying them, ensuring correctness while maintaining concurrent execution efficiency.

Inventive Principle:
Principle #23Feedback

Solution Approach 2:

The system performs preliminary actions by recording all memory transactions in logs before commitment. This preliminary recording allows the system to verify consistency and detect potential conflicts before they result in incorrect results, enabling safe concurrent access to shared memory while maintaining reliability.

Inventive Principle:
Principle #10Preliminary action

3Reliability

If transactional memory with logging is used to verify data consistency, then correctness of concurrent operations is improved, but overhead and execution time increase

Engineering Contradiction:
Improvedata consistencyVSAvoidtransaction verification time
Core Design Contradiction:
ReliabilityVSLoss of time

Solution Approach 1:

The patent applies partial action by selectively verifying only the specific memory transactions that are relevant to each thread's operation. Rather than verifying all possible transactions, the system focuses on the subset of transactions that could potentially conflict, reducing verification overhead while maintaining data consistency.

Inventive Principle:
Principle #16Partial or excessive action

Solution Approach 2:

The system dynamically adjusts verification parameters based on transaction characteristics and conflict detection results. By changing verification intensity and scope according to actual runtime conditions, the system minimizes overhead for straightforward transactions while maintaining rigorous verification when conflicts are detected, balancing reliability and execution time.

Inventive Principle:
Principle #35Parameter changes

Data Source

PatentUS9286139B2Automatic mutual exclusion
Publication Date: 2016.03.15 MICROSOFT TECHNOLOGY LICENSING LLC
  • US9286139B2 patent drawing
  • US9286139B2 patent drawing
  • US9286139B2 patent drawing

AI summary

An automatic mutual exclusion computer programming system is disclosed which allows a programmer to produce concurrent programming code that is synchronized by default without the need to write any synchronization code. The programmer creates asynchronous methods which are not permitted make changes to shared memory that they cannot reverse, and can execute concurrently with other asynchronous methods. Changes to shared memory are committed if no other thread has accessed shared memory while the asynchronous method executed. Changes are reversed and the asynchronous method is re-executed if another thread has made changes to shared memory. The resulting program executes in a serialized order. A blocking system method is disclosed which causes the asynchronous method to re-execute until the blocking method's predicate results in an appropriate value. A yield system call is disclosed which divides asynchronous methods into atomic fragments. When a yield method call is made, shared memory changes are committed if possible or reversed and the atomic fragment is re-executed.