Deterministic Concurrency Testing via Thread Control

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Current concurrency testing methods for database systems are non-deterministic and fail to reliably simulate conditions such as thread timeouts and race conditions, making it difficult to test and reproduce issues effectively.

Innovation Solution

A system that executes application code in a test environment where actions defined separately from the code are retrieved and performed by threads at specified locations, using a counter to control thread progression and a hash table to store actions, allowing developers to simulate specific conditions like thread timeouts and race conditions deterministically.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If traditional stress testing is used to test thread concurrency, then the system can be tested under load, but the testing results are non-deterministic and cannot reliably reproduce specific conditions like timeouts and race conditions

Engineering Contradiction:
Improvetesting reliabilityVSAvoidtime to reproduce issues
Core Design Contradiction:
ReliabilityVSLoss of time

Solution Approach 1:

The patent applies preliminary action by pre-defining specific concurrency scenarios and conditions (such as timeout values, race conditions, and thread interaction patterns) before executing the test. The testing framework allows developers to specify desired thread behaviors and timing conditions in advance, then orchestrates the execution to reliably reproduce these pre-planned scenarios, eliminating the non-deterministic nature of traditional stress testing.

Inventive Principle:
Principle #10Preliminary action

2Adaptability or versatility

If multiple threads operate on similar resources with thread scheduling algorithm, then concurrency testing can be performed, but detrimental conditions like deadlocks and race conditions may arise that are difficult to reproduce

Engineering Contradiction:
Improvetesting capabilityVSAvoiddifficulty to reproduce conditions
Core Design Contradiction:
Adaptability or versatilityVSDifficulty of detecting and measuring

Solution Approach 1:

The patent introduces an intermediary testing framework that sits between the thread scheduling algorithm and the application code. This framework monitors and controls thread execution, resource access, and timing conditions, allowing developers to detect and measure concurrency issues systematically. The intermediary layer provides hooks and instrumentation points that make previously undetectable conditions observable and reproducible.

Inventive Principle:
Principle #24Intermediary (Mediator)

3Productivity

If threads are swapped around by thread scheduling algorithm, then processor utilization is improved, but deterministic testing of specific thread interactions becomes impossible

Engineering Contradiction:
Improveprocessor utilizationVSAvoidtesting precision
Core Design Contradiction:
ProductivityVSManufacturing precision

Solution Approach 1:

The patent applies dynamics by creating a hybrid testing approach that combines dynamic thread scheduling with controlled intervention. The system allows threads to be scheduled dynamically for realistic performance testing, while simultaneously providing mechanisms to pause, inspect, and control thread execution at specific points. This dynamic control enables deterministic reproduction of specific thread interactions while maintaining overall system productivity.

Inventive Principle:
Principle #15Dynamics

Data Source

PatentUS11243873B2Concurrency testing
Publication Date: 2022.02.08 SALESFORCE INC
  • US11243873B2 patent drawing
  • US11243873B2 patent drawing
  • US11243873B2 patent drawing

AI summary

Techniques are disclosed relating to testing application code. A computer system, in various embodiments, receives application code to be tested by the computer system and separate information defining actions to be performed at specified locations within the application code. In various embodiments, the computer system executes the application code in a test environment in which the actions defined by the separate information are retrieved and performed by a plurality of threads of the application code at the specified locations to control flow of the plurality of threads through the application code. In some embodiments, a first one of the plurality of threads is operable to perform at least one of the actions to control the flow of a second one of the plurality of threads.