Multithreading Debugging via Breakpoint Context Switch Conversion

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Current debugging and testing methods for multithreading and concurrent programming are ineffective in detecting and reproducing concurrency errors, as they lack control over the execution paths of threads and the execution environment, making it difficult to debug multithreaded programs.

Innovation Solution

A method that supports multithreading/concurrent programming debugging by aborting the operating system's schedule and introducing a novel breakpoint-context switch point to control the interleaving execution path, allowing for easy reproduction of the execution sequence of each thread's program sections and enabling precise program debugging.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Productivity

If multithreading and concurrent programming techniques are introduced to software systems, then processing efficiency is improved, but execution path complexity increases exponentially making concurrency errors harder to detect and debug

Engineering Contradiction:
Improveprocessing efficiencyVSAvoidexecution path complexity
Core Design Contradiction:
ProductivityVSDevice complexity

Solution Approach 1:

The patent segments the complex multithreaded execution into discrete program sections with assigned priorities. Each program section is independently manageable and can be scheduled according to its priority level, breaking down the exponentially complex execution paths into controllable segments that can be systematically debugged and analyzed.

Inventive Principle:
Principle #1Segmentation

2Ease of operation

If traditional debugging methods are used for multithreading, then general debugging capabilities are maintained, but control over thread execution paths and environment switching is lost

Engineering Contradiction:
Improvedebugging capabilityVSAvoidexecution path control
Core Design Contradiction:
Ease of operationVSExtent of automation

Solution Approach 1:

The patent introduces a debugger as an intermediary layer between the multithreaded program and the operating system scheduler. This debugger intercepts and controls context switching operations, allowing programmers to set breakpoints, control thread execution order, and monitor program sections while maintaining the benefits of multithreading. The debugger acts as a mediator that provides both automatic scheduling and manual control capabilities.

Inventive Principle:
Principle #24Intermediary (Mediator)

3Reliability

If the operating system schedule is allowed to run freely during debugging, then system responsiveness is maintained, but the ability to reproduce specific execution paths is lost

Engineering Contradiction:
Improvesystem responsivenessVSAvoidexecution path reproducibility
Core Design Contradiction:
ReliabilityVSDifficulty of detecting and measuring

Solution Approach 1:

The patent enables preliminary setup of breakpoints and priority assignments for program sections before execution. Programmers can pre-configure the debugging environment with specific thread priorities and breakpoint locations, allowing systematic reproduction of execution paths while the system maintains responsiveness during actual runtime. This preliminary configuration enables controlled reexecution of specific scenarios.

Inventive Principle:
Principle #10Preliminary action

Data Source

PatentUS10649883B2Method that supports multithreading/concurrent programming debugging, computer readable recording medium and computer program product
Publication Date: 2020.05.12 NAT CENT UNIV
  • US10649883B2 patent drawing
  • US10649883B2 patent drawing
  • US10649883B2 patent drawing

AI summary

A method that supports multithreading/concurrent programming debugging includes the following steps: setting breakpoints of program sections of multithreading; converting the breakpoints into context switch points; executing a planned execution sequence of an interleaving execution path, to start a specified thread to execute a program section thereof till a first execution environment change point; clicking a next thread of the interleaving execution path one after another, and executing the clicked next thread till a next context switch point; and recording and storing the interleaving execution path.