API Interception Thread Segmentation for Deadlock Prevention
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Conventional API monitoring techniques often result in deadlocks, livelocks, and unintended side-effects due to the invocation of secondary APIs within the interception of primary APIs, leading to serialization delays and potential perpetual interceptions.
Innovation Solution
Invoking a second API within the interception of a first API using a separate thread, allowing for timeout capabilities and preventing recursive lock acquisition failures, thus avoiding deadlocks and unintended side-effects.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If a secondary API is invoked from within the interception of the first API using the same thread, then the monitoring function is achieved, but deadlock and livelock occur due to resource unavailability
Solution Approach 1:
The patent divides the thread execution into separate segments: the first thread executes the primary API invocation while the second thread executes the secondary API invocation. This segmentation allows each thread to independently manage its own resources and execution context, preventing the deadlock and livelock conditions that would occur if both APIs were invoked within the same thread context.
Solution Approach 2:
The patent introduces a second thread as an intermediary between the first API invocation and the secondary API invocation. This intermediary thread structure allows the secondary API to be executed without blocking the first thread, thereby preventing resource unavailability issues and enabling reliable API monitoring without harmful side effects.
2Reliability
If a secondary API is invoked from within the interception of the first API, then monitoring is performed, but unnecessary serialization occurs causing delay in completion
Solution Approach 1:
The patent segments the API invocation process into two independent threads, allowing the first API and secondary API to execute in parallel rather than serially. This eliminates unnecessary serialization and reduces the time loss that would otherwise occur while waiting for the first API to complete before invoking the secondary API.
Solution Approach 2:
The patent implements dynamic thread management where the second thread is created and executed independently of the first thread's completion status. This dynamic approach allows the system to adapt the execution timing of secondary APIs based on actual resource availability and monitoring needs, rather than being constrained by fixed serialization order.
3Reliability
If a secondary API is invoked from within the first API context, then monitoring is achieved, but unintended effects occur such as manipulation of thread-specific data
Solution Approach 1:
The patent segments the execution context by creating a separate second thread for the secondary API invocation. This segmentation ensures that each thread maintains its own execution context and thread-specific data, preventing the secondary API from inadvertently manipulating data belonging to the first thread while still achieving comprehensive monitoring functionality.
4Reliability
If a secondary API without timeout support is invoked within the first API, then monitoring is performed, but the first API is perpetually intercepted
Solution Approach 1:
The patent segments the API invocation into separate threads, allowing the first API to complete its execution independently of the secondary API's timeout status. This segmentation ensures that the first API is not perpetually intercepted or blocked by the second thread's lack of timeout support, as each thread manages its own execution lifecycle.
Data Source
AI summary
A system, method, and computer program product are provided for invoking an application program interface within an interception of another application program interface. In use, a first application program interface invoked utilizing a first thread is intercepted. Further, a second application program interface is invoked within the interception of the first application program interface, utilizing a second thread.


